Beispiel #1
0
 def setUp(self):
     """ setup any state tied to the execution of the given method in a
     class.  setup_method is invoked for every test method of a class.
     """
     self.cache = RedisStorage(RedisMock(), prefix='pre::', encoder=json)
     self.recommendations = RedisStorage(RedisMock(), 'recommendations::')
     self.queues = RedisQueue(RedisMock(), encoder=json)
     self.obelix = Obelix(self.cache, self.recommendations, self.queues)
Beispiel #2
0
 def test_redis_set_and_get_with_prefix_encoder(self):
     storage = RedisStorage(RedisMock(), prefix='pre::', encoder=json)
     storage.set("theKey", "theValue")
     storage.set("theKey2", "theValue2")
     assert storage.get("theKey2") == "theValue2"
     assert storage.get("theKey") == "theValue"
     assert storage.get("noKey") == None