Exemplo n.º 1
0
    def test_uses_repr_format(self):
        KEY = ['a', 1]
        VALUE = {'foo': {'bar': 3}, 'baz': None}
        ENCODED = '%r\t%r' % (KEY, VALUE)

        self.assertEqual((KEY, VALUE), ReprProtocol.read(ENCODED))
        self.assertEqual(ENCODED, ReprProtocol.write(KEY, VALUE))
Exemplo n.º 2
0
    def test_uses_repr_format(self):
        KEY = ['a', 1]
        VALUE = {'foo': {'bar': 3}, 'baz': None}
        ENCODED = '%r\t%r' % (KEY, VALUE)

        self.assertEqual((KEY, VALUE), ReprProtocol.read(ENCODED))
        self.assertEqual(ENCODED, ReprProtocol.write(KEY, VALUE))
Exemplo n.º 3
0
 def test_can_encode_point_but_not_decode(self):
     points_encoded = ReprProtocol.write(Point(2, 3), Point(1, 4))
     self.assertCantDecode(ReprProtocol, points_encoded)
Exemplo n.º 4
0
 def test_can_encode_point_but_not_decode(self):
     points_encoded = ReprProtocol.write(Point(2, 3), Point(1, 4))
     self.assertCantDecode(ReprProtocol, points_encoded)