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