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))
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))
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))
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))
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))