142
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'======'])))
145
186
class TestRemoteGitBranchFormat(TestCase):
565
606
self.assertEqual(
566
607
{'': 'master', 'blah': 'blah', 'master': 'master'},
567
608
{n: b.name for (n, b) in remote.get_branches().items()})
610
set(['', 'blah', 'master']), set(remote.branch_names()))
569
612
def test_remove_tag(self):
570
613
c1 = self.remote_real.do_commit(