Beispiel #1
0
 def test_serialization(self):
     name = "obj"
     obj = {"test":1}
     serialization.serialize(obj, name)
     assert os.path.join(config.prefix, "obj.pck")
     
     obj2 = serialization.unserialize(name)
     assert obj == obj2
Beispiel #2
0
 def test_serialize_inexistent_prefix(self):
     name = "obj"
     obj = {"test":1}
     prefix = config.prefix
     config.prefix = os.path.join(prefix, "dir")
     serialization.serialize(obj, name)
     assert os.path.exists(config.prefix)
     assert os.path.join(config.prefix, "obj.pck")
     config.prefix = prefix