/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: 2018-10-13 19:53:32 UTC
  • mfrom: (7131.7.4 more-git-errors)
  • Revision ID: breezy.the.bot@gmail.com-20181013195332-zswofkblwo1wv5eb
Handle some more Git error strings and convert them to specific exceptions.

Merged from https://code.launchpad.net/~jelmer/brz/more-git-errors/+merge/355811

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
        e = parse_git_error("url", "Repository not found.\n")
97
97
        self.assertIsInstance(e, NotBranchError)
98
98
 
 
99
    def test_notbrancherror_normal(self):
 
100
        e = parse_git_error("url", "fatal: '/srv/git/lintian-brush' does not appear to be a git repository")
 
101
        self.assertIsInstance(e, NotBranchError)
 
102
 
99
103
    def test_head_update(self):
100
104
        e = parse_git_error("url", "HEAD failed to update\n")
101
105
        self.assertIsInstance(e, HeadUpdateFailed)
106
110
            "access denied or repository not exported: /debian/altermime.git")
107
111
        self.assertIsInstance(e, PermissionDenied)
108
112
 
 
113
    def test_permission_denied_gitlab(self):
 
114
        e = parse_git_error(
 
115
            "url",
 
116
            'GitLab: You are not allowed to push code to this project.\n')
 
117
        self.assertIsInstance(e, PermissionDenied)
 
118
 
 
119
    def test_permission_denied_github(self):
 
120
        e = parse_git_error(
 
121
            "url",
 
122
            'Permission to porridge/gaduhistory.git denied to jelmer.')
 
123
        self.assertIsInstance(e, PermissionDenied)
 
124
        self.assertEqual(e.path, 'porridge/gaduhistory.git')
 
125
        self.assertEqual(e.extra, ': denied to jelmer')
 
126
 
109
127
 
110
128
class TestRemoteGitBranchFormat(TestCase):
111
129