mirror of
https://github.com/senju1337/senju.git
synced 2025-12-24 07:39:29 +00:00
refactor: integrate get_latest_haiku_or_default into load_haiku
Refs: OPS-65
This commit is contained in:
parent
cf48ac8164
commit
8f3ccb94d1
2 changed files with 7 additions and 13 deletions
|
|
@ -37,6 +37,7 @@ def test_save_and_load_haiku(store_manager: StoreManager):
|
|||
but should have"
|
||||
|
||||
assert h == h_loaded
|
||||
assert h != DEFAULT_HAIKU
|
||||
|
||||
|
||||
def test_load_latest_with_empty_store(temp_data_dir):
|
||||
|
|
@ -47,7 +48,7 @@ def test_load_latest_with_empty_store(temp_data_dir):
|
|||
|
||||
def test_load_latest_or_default_with_empty(temp_data_dir):
|
||||
store = StoreManager(temp_data_dir / "load_or_default_empty.json")
|
||||
haiku = store.get_latest_haiku_or_default()
|
||||
haiku = store.load_haiku(store.get_id_of_latest_haiku())
|
||||
assert haiku == DEFAULT_HAIKU
|
||||
|
||||
|
||||
|
|
@ -55,6 +56,6 @@ def test_load_latest_or_default_with_non_empty(temp_data_dir):
|
|||
store = StoreManager(temp_data_dir / "load_or_default_not_empty.json")
|
||||
nonsense_test_haiku = Haiku(["nonsense", "test", "haiku"])
|
||||
store.save_haiku(nonsense_test_haiku)
|
||||
haiku = store.get_latest_haiku_or_default()
|
||||
haiku = store.load_haiku(store.get_id_of_latest_haiku())
|
||||
assert haiku != DEFAULT_HAIKU
|
||||
assert haiku == nonsense_test_haiku
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue