def test_roundtrip_format_unicode(self): for _ in range(500): v = get_random_object() self.assertEqual(v, tnetstring.loads(tnetstring.dumps(v))) self.assertEqual((v, b''), tnetstring.pop(tnetstring.dumps(v)))
def test_roundtrip_format_unicode(self): for _ in range(500): v = get_random_object() self.assertEqual(v, tnetstring.loads(tnetstring.dumps(v))) self.assertEqual((v, b''), tnetstring.pop(tnetstring.dumps(v)))
def test_roundtrip_format_examples(self): for data, expect in FORMAT_EXAMPLES.items(): self.assertEqual(expect, tnetstring.loads(data)) self.assertEqual( expect, tnetstring.loads(tnetstring.dumps(expect))) self.assertEqual((expect, b''), tnetstring.pop(data))
def test_roundtrip_format_examples(self): for data, expect in FORMAT_EXAMPLES.items(): self.assertEqual(expect, tnetstring.loads(data)) self.assertEqual( expect, tnetstring.loads(tnetstring.dumps(expect))) self.assertEqual((expect, b''), tnetstring.pop(data))