Beispiel #1
0
 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"")
Beispiel #2
0
 def test_parse(self):
     s = GreedyString("foo", encoding="utf8")
     self.assertEqual(s.parse(six.b("hello\x00")), six.u("hello\x00"))
Beispiel #3
0
 def test_parse(self):
     s = GreedyString("foo", encoding="utf8")
     self.assertEqual(s.parse(b"hello\x00"), u("hello\x00"))