def test_load():
pu = p_utils.PickleUtils()
filename = os.path.join(TEST_RESOURCES, 'test.pickle')
expected_data = {
'test': 'string'
}
with open(filename, 'wb') as f:
pickle.dump(expected_data, f, pickle.HIGHEST_PROTOCOL)
data = pu.load(filename)
assert os.path.exists(filename)
assert expected_data['test'] == data['test']
# Cleanup
os.remove(filename)
评论列表
文章目录