/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-07-26 17:52:41 UTC
  • mfrom: (7371.3.3 git-http-branch-url)
  • Revision ID: breezy.the.bot@gmail.com-20190726175241-5l7idcs4k55zs5ia
Fix extraction of paths from URLs when operating on remote Git repositories.

Merged from https://code.launchpad.net/~jelmer/brz/git-http-branch-url/+merge/370161

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')