Пример #1
0
 def test_set_and_get_with_prefix_encoder(self):
     storage = StorageProxy({}, 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
Пример #2
0
 def test_set_and_get(self):
     storage = StorageProxy({})
     storage.set("theKey", "theValue")
     storage.set("theKey2", "theValue2")
     assert storage.get("theKey2") == "theValue2"
     assert storage.get("theKey") == "theValue"
     assert storage.get("noKey") == None
Пример #3
0
 def test_set_and_get_with_prefix_encoder(self):
     storage = StorageProxy({}, 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
Пример #4
0
 def test_set_and_get(self):
     storage = StorageProxy({})
     storage.set("theKey", "theValue")
     storage.set("theKey2", "theValue2")
     assert storage.get("theKey2") == "theValue2"
     assert storage.get("theKey") == "theValue"
     assert storage.get("noKey") == None