Exemplo n.º 1
0
 def test_update_refs_error(self):
     parser = ReportStatusParser()
     parser.handle_packet(b"unpack ok")
     parser.handle_packet(b"ng refs/foo/bar need to pull")
     parser.handle_packet(None)
     self.assertEqual(
         [(b'refs/foo/bar', 'need to pull')], list(parser.check()))
Exemplo n.º 2
0
 def test_ok(self):
     parser = ReportStatusParser()
     parser.handle_packet(b"unpack ok")
     parser.handle_packet(b"ok refs/foo/bar")
     parser.handle_packet(None)
     parser.check()
Exemplo n.º 3
0
 def test_update_refs_error(self):
     parser = ReportStatusParser()
     parser.handle_packet(b"unpack ok")
     parser.handle_packet(b"ng refs/foo/bar need to pull")
     parser.handle_packet(None)
     self.assertRaises(UpdateRefsError, parser.check)
Exemplo n.º 4
0
 def test_invalid_pack(self):
     parser = ReportStatusParser()
     parser.handle_packet(b"unpack error - foo bar")
     parser.handle_packet(b"ok refs/foo/bar")
     parser.handle_packet(None)
     self.assertRaises(SendPackError, parser.check)
Exemplo n.º 5
0
 def test_ok(self):
     parser = ReportStatusParser()
     parser.handle_packet("unpack ok")
     parser.handle_packet("ok refs/foo/bar")
     parser.handle_packet(None)
     parser.check()
Exemplo n.º 6
0
 def test_update_refs_error(self):
     parser = ReportStatusParser()
     parser.handle_packet("unpack ok")
     parser.handle_packet("ng refs/foo/bar need to pull")
     parser.handle_packet(None)
     self.assertRaises(UpdateRefsError, parser.check)
Exemplo n.º 7
0
 def test_invalid_pack(self):
     parser = ReportStatusParser()
     parser.handle_packet("unpack error - foo bar")
     parser.handle_packet("ok refs/foo/bar")
     parser.handle_packet(None)
     self.assertRaises(SendPackError, parser.check)
Exemplo n.º 8
0
 def test_ok(self):
     parser = ReportStatusParser()
     parser.handle_packet(b"unpack ok")
     parser.handle_packet(b"ok refs/foo/bar")
     parser.handle_packet(None)
     self.assertEqual([(b'refs/foo/bar', None)], list(parser.check()))