summaryrefslogtreecommitdiffstats
path: root/tests/state_json_unittest.py
blob: 03ea555d5b482257cd2adbbc8bb961478989a7a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import pytest

from flashcards import state_json

def test_saveAndLoad(tmp_path):
    file = tmp_path / "test.json"
    state = {"key": [10, 20, None], "another_key": "value"}

    state_json.save(file, state)
    
    assert state_json.load(file) == state

def test_missingFile(tmp_path):
    assert state_json.load(tmp_path / "missing.json") == {}