/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/git/tests/test_remote.py

  • Committer: Jelmer Vernooij
  • Date: 2019-08-11 13:21:03 UTC
  • mfrom: (7379 work)
  • mto: This revision was merged to the branch mainline in revision 7388.
  • Revision ID: jelmer@jelmer.uk-20190811132103-u3ne03yf37c1h57n
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    HeadUpdateFailed,
45
45
    RemoteGitError,
46
46
    RemoteGitBranchFormat,
 
47
    _git_url_and_path_from_transport,
47
48
    )
48
49
 
49
50
from dulwich import porcelain
601
602
            author=b'author <author@example.com>')
602
603
        remote = ControlDir.open(self.remote_url)
603
604
        self.assertEqual('master', remote.open_branch().nick)
 
605
 
 
606
 
 
607
class GitUrlAndPathFromTransportTests(TestCase):
 
608
 
 
609
    def test_file(self):
 
610
        split_url = _git_url_and_path_from_transport('file:///home/blah')
 
611
        self.assertEqual(split_url.scheme, 'file')
 
612
        self.assertEqual(split_url.path, '/home/blah')
 
613
 
 
614
    def test_file_segment_params(self):
 
615
        split_url = _git_url_and_path_from_transport('file:///home/blah,branch=master')
 
616
        self.assertEqual(split_url.scheme, 'file')
 
617
        self.assertEqual(split_url.path, '/home/blah')
 
618
 
 
619
    def test_git_smart(self):
 
620
        split_url = _git_url_and_path_from_transport(
 
621
            'git://github.com/dulwich/dulwich,branch=master')
 
622
        self.assertEqual(split_url.scheme, 'git')
 
623
        self.assertEqual(split_url.path, '/dulwich/dulwich')
 
624
 
 
625
    def test_https(self):
 
626
        split_url = _git_url_and_path_from_transport(
 
627
            'https://github.com/dulwich/dulwich')
 
628
        self.assertEqual(split_url.scheme, 'https')
 
629
        self.assertEqual(split_url.path, '/dulwich/dulwich')
 
630
 
 
631
    def test_https_segment_params(self):
 
632
        split_url = _git_url_and_path_from_transport(
 
633
            'https://github.com/dulwich/dulwich,branch=master')
 
634
        self.assertEqual(split_url.scheme, 'https')
 
635
        self.assertEqual(split_url.path, '/dulwich/dulwich')