def test_write(self): """Write an in memory KVS to a file""" remove_file(self.KVS_FILENAME) kvs = KVS() kvs["tv1"] = TV(1) kvs.write(self.KVS_FILENAME) show_file(self.KVS_FILENAME)
def test_load_cache(self): """Load record from a kvs file into the kvs cache""" # create a file to test against remove_file(self.KVS_FILENAME) kvs = KVS() kvs["tv1"] = TV(1) kvs.write(self.KVS_FILENAME) kvs = KVS() # clear it out again # load the file kvs.load(self.KVS_FILENAME) # check the state of the kvs memory print(kvs.store) # check state of the kvs file at end show_file(self.KVS_FILENAME)