From 7f426636ec9a378a9e1cdcfabb313d09c3465e0c Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Wed, 17 Mar 2021 00:48:28 -0500 Subject: [PATCH] We want cache to work with dict --- tests/test_cache.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_cache.py b/tests/test_cache.py index 9458e14..3ed07fd 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -28,3 +28,12 @@ def test_cache_write_store_load_read(tmp_path): c.store() c_load = Cache(tmp_path) assert c_load.read("key") == "val" + + +def test_cache_write_store_load_read_with_dict(tmp_path): + c = Cache(tmp_path) + c.write("key", {"key": "val"}) + c.store() + c_load = Cache(tmp_path) + assert isinstance(c_load.read("key"), dict) + assert c_load.read("key")["key"] == "val"