示例#1
0
    def check(self, value, expected_flags):
        serialized, flags = python_memcache_serializer(b'key', value)
        assert flags == expected_flags

        # pymemcache stores values as byte strings, so we immediately the value
        # if needed so deserialized works as it would with a real server
        if not isinstance(serialized, six.binary_type):
            serialized = six.text_type(serialized).encode('ascii')

        deserialized = python_memcache_deserializer(b'key', serialized, flags)
        assert deserialized == value
示例#2
0
 def check(self, value):
     serialized, flags = python_memcache_serializer(b'key', value)
     deserialized = python_memcache_deserializer(b'key', serialized, flags)
     assert deserialized == value
 def check(self, value):
     serialized, flags = python_memcache_serializer(b'key', value)
     deserialized = python_memcache_deserializer(b'key', serialized, flags)
     assert deserialized == value