144
144
self.assertIsInstance(e, NotBranchError)
147
class ParseHangupTests(TestCase):
150
super(ParseHangupTests, self).setUp()
152
HangupException([b'foo'])
154
self.skipTest('dulwich version too old')
156
def test_not_set(self):
157
self.assertIsInstance(
158
parse_git_hangup('http://', HangupException()), HangupException)
160
def test_single_line(self):
162
RemoteGitError('foo bar'),
163
parse_git_hangup('http://', HangupException([b'foo bar'])))
165
def test_multi_lines(self):
167
RemoteGitError('foo bar\nbla bla'),
169
'http://', HangupException([b'foo bar', b'bla bla'])))
171
def test_filter_boring(self):
173
RemoteGitError('foo bar'), parse_git_hangup('http://', HangupException(
174
[b'=======', b'foo bar', b'======'])))
176
def test_permission_denied(self):
178
PermissionDenied('http://', 'You are not allowed to push code to this project.'),
183
b'You are not allowed to push code to this project.', b'', b'======'])))
147
186
class TestRemoteGitBranchFormat(TestCase):