コード例 #1
0
ファイル: test_server.py プロジェクト: jaraco/dulwich
 def test_split_proto_line(self):
     allowed = ("want", "done", None)
     self.assertEqual(("want", ONE), _split_proto_line("want %s\n" % ONE, allowed))
     self.assertEqual(("want", TWO), _split_proto_line("want %s\n" % TWO, allowed))
     self.assertRaises(GitProtocolError, _split_proto_line, "want xxxx\n", allowed)
     self.assertRaises(UnexpectedCommandError, _split_proto_line, "have %s\n" % THREE, allowed)
     self.assertRaises(GitProtocolError, _split_proto_line, "foo %s\n" % FOUR, allowed)
     self.assertRaises(GitProtocolError, _split_proto_line, "bar", allowed)
     self.assertEqual(("done", None), _split_proto_line("done\n", allowed))
     self.assertEqual((None, None), _split_proto_line("", allowed))
コード例 #2
0
ファイル: test_server.py プロジェクト: rockstar/dulwich
 def test_split_proto_line(self):
     allowed = (b"want", b"done", None)
     self.assertEqual((b"want", ONE), _split_proto_line(b"want " + ONE + b"\n", allowed))
     self.assertEqual((b"want", TWO), _split_proto_line(b"want " + TWO + b"\n", allowed))
     self.assertRaises(GitProtocolError, _split_proto_line, b"want xxxx\n", allowed)
     self.assertRaises(UnexpectedCommandError, _split_proto_line, b"have " + THREE + b"\n", allowed)
     self.assertRaises(GitProtocolError, _split_proto_line, b"foo " + FOUR + b"\n", allowed)
     self.assertRaises(GitProtocolError, _split_proto_line, b"bar", allowed)
     self.assertEqual((b"done", None), _split_proto_line(b"done\n", allowed))
     self.assertEqual((None, None), _split_proto_line(b"", allowed))
コード例 #3
0
ファイル: test_server.py プロジェクト: ardumont/dulwich
 def test_split_proto_line(self):
     allowed = (b'want', b'done', None)
     self.assertEqual((b'want', ONE),
                       _split_proto_line(b'want ' + ONE + b'\n', allowed))
     self.assertEqual((b'want', TWO),
                       _split_proto_line(b'want ' + TWO + b'\n', allowed))
     self.assertRaises(GitProtocolError, _split_proto_line,
                       b'want xxxx\n', allowed)
     self.assertRaises(UnexpectedCommandError, _split_proto_line,
                       b'have ' + THREE + b'\n', allowed)
     self.assertRaises(GitProtocolError, _split_proto_line,
                       b'foo ' + FOUR + b'\n', allowed)
     self.assertRaises(GitProtocolError, _split_proto_line, b'bar', allowed)
     self.assertEqual((b'done', None), _split_proto_line(b'done\n', allowed))
     self.assertEqual((None, None), _split_proto_line(b'', allowed))
コード例 #4
0
 def test_split_proto_line(self):
     allowed = ('want', 'done', None)
     self.assertEqual(('want', ONE),
                      _split_proto_line('want %s\n' % ONE, allowed))
     self.assertEqual(('want', TWO),
                      _split_proto_line('want %s\n' % TWO, allowed))
     self.assertRaises(GitProtocolError, _split_proto_line, 'want xxxx\n',
                       allowed)
     self.assertRaises(UnexpectedCommandError, _split_proto_line,
                       'have %s\n' % THREE, allowed)
     self.assertRaises(GitProtocolError, _split_proto_line,
                       'foo %s\n' % FOUR, allowed)
     self.assertRaises(GitProtocolError, _split_proto_line, 'bar', allowed)
     self.assertEqual(('done', None), _split_proto_line('done\n', allowed))
     self.assertEqual((None, None), _split_proto_line('', allowed))
コード例 #5
0
ファイル: test_server.py プロジェクト: tgalal/dulwich
 def test_split_proto_line(self):
     allowed = (b'want', b'done', None)
     self.assertEqual((b'want', ONE),
                       _split_proto_line(b'want ' + ONE + b'\n', allowed))
     self.assertEqual((b'want', TWO),
                       _split_proto_line(b'want ' + TWO + b'\n', allowed))
     self.assertRaises(GitProtocolError, _split_proto_line,
                       b'want xxxx\n', allowed)
     self.assertRaises(UnexpectedCommandError, _split_proto_line,
                       b'have ' + THREE + b'\n', allowed)
     self.assertRaises(GitProtocolError, _split_proto_line,
                       b'foo ' + FOUR + b'\n', allowed)
     self.assertRaises(GitProtocolError, _split_proto_line, b'bar', allowed)
     self.assertEqual((b'done', None), _split_proto_line(b'done\n', allowed))
     self.assertEqual((None, None), _split_proto_line(b'', allowed))
コード例 #6
0
ファイル: test_server.py プロジェクト: ChipJust/dulwich
 def test_split_proto_line(self):
     allowed = ('want', 'done', None)
     self.assertEqual(('want', ONE),
                       _split_proto_line('want %s\n' % ONE, allowed))
     self.assertEqual(('want', TWO),
                       _split_proto_line('want %s\n' % TWO, allowed))
     self.assertRaises(GitProtocolError, _split_proto_line,
                       'want xxxx\n', allowed)
     self.assertRaises(UnexpectedCommandError, _split_proto_line,
                       'have %s\n' % THREE, allowed)
     self.assertRaises(GitProtocolError, _split_proto_line,
                       'foo %s\n' % FOUR, allowed)
     self.assertRaises(GitProtocolError, _split_proto_line, 'bar', allowed)
     self.assertEqual(('done', None), _split_proto_line('done\n', allowed))
     self.assertEqual((None, None), _split_proto_line('', allowed))
コード例 #7
0
 def test_split_proto_line(self):
     allowed = (b"want", b"done", None)
     self.assertEqual((b"want", ONE),
                      _split_proto_line(b"want " + ONE + b"\n", allowed))
     self.assertEqual((b"want", TWO),
                      _split_proto_line(b"want " + TWO + b"\n", allowed))
     self.assertRaises(GitProtocolError, _split_proto_line, b"want xxxx\n",
                       allowed)
     self.assertRaises(
         UnexpectedCommandError,
         _split_proto_line,
         b"have " + THREE + b"\n",
         allowed,
     )
     self.assertRaises(
         GitProtocolError,
         _split_proto_line,
         b"foo " + FOUR + b"\n",
         allowed,
     )
     self.assertRaises(GitProtocolError, _split_proto_line, b"bar", allowed)
     self.assertEqual((b"done", None),
                      _split_proto_line(b"done\n", allowed))
     self.assertEqual((None, None), _split_proto_line(b"", allowed))