コード例 #1
0
ファイル: test_client.py プロジェクト: codilemma/Python_env
 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()))
コード例 #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()
コード例 #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)
コード例 #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)
コード例 #5
0
ファイル: test_client.py プロジェクト: imclab/dulwich
 def test_ok(self):
     parser = ReportStatusParser()
     parser.handle_packet("unpack ok")
     parser.handle_packet("ok refs/foo/bar")
     parser.handle_packet(None)
     parser.check()
コード例 #6
0
ファイル: test_client.py プロジェクト: imclab/dulwich
 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)
コード例 #7
0
ファイル: test_client.py プロジェクト: imclab/dulwich
 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)
コード例 #8
0
ファイル: test_client.py プロジェクト: codilemma/Python_env
 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()))