def test_parse(self): s = GreedyString("s", encoding="utf8") self.assertEqual(s.parse(b"hello\x00"), u"hello\x00") self.assertEqual(s.parse(b""), u"") s = GreedyString("s") self.assertEqual(s.parse(b"hello\x00"), b"hello\x00") self.assertEqual(s.parse(b""), b"")
def test_parse(self): s = GreedyString("foo", encoding="utf8") self.assertEqual(s.parse(six.b("hello\x00")), six.u("hello\x00"))
def test_parse(self): s = GreedyString("foo", encoding="utf8") self.assertEqual(s.parse(b"hello\x00"), u("hello\x00"))