mirror of
https://github.com/senju1337/senju.git
synced 2025-12-24 07:39:29 +00:00
test: refactor store manager tests for changes
Refs: 9f3ebf6e98d0fc8a7d32e251a4468866bd55a076 OPS-22
This commit is contained in:
parent
4ce43ec54d
commit
588cbeb001
2 changed files with 5 additions and 3 deletions
|
|
@ -14,4 +14,4 @@ def temp_data_dir():
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def store_manager(temp_data_dir):
|
def store_manager(temp_data_dir):
|
||||||
return StoreManager(temp_data_dir/"store.db")
|
return StoreManager(temp_data_dir/"store.json")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
# do not remove this import. This is needed for
|
# do not remove this import. This is needed for
|
||||||
# pytest fixtures to work
|
# pytest fixtures to work
|
||||||
|
from pathlib import Path
|
||||||
import pytest # noqa: F401
|
import pytest # noqa: F401
|
||||||
|
|
||||||
from senju.haiku import Haiku
|
from senju.haiku import Haiku
|
||||||
|
|
@ -36,6 +37,7 @@ def test_save_and_load_haiku(store_manager: StoreManager):
|
||||||
assert h == h_loaded
|
assert h == h_loaded
|
||||||
|
|
||||||
|
|
||||||
def test_load_latest_with_empty_store(store_manager: StoreManager):
|
def test_load_latest_with_empty_store(temp_data_dir):
|
||||||
h = store_manager.load_latest_haiku()
|
store = StoreManager(temp_data_dir / "empty_store.json")
|
||||||
|
h = store.get_id_of_latest_haiku()
|
||||||
assert h is None
|
assert h is None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue