Keep the tests away from the real data.txt

Refs #27
Task: MIL-004#5
This commit is contained in:
2026-10-13 14:38:54 +08:00
parent 4ef3874bb1
commit ba0ae0e698
2 changed files with 28 additions and 0 deletions
+12
View File
@@ -1,5 +1,7 @@
"""Tests of the main flow, with fakes instead of a real screen."""
from pathlib import Path
import pytest
from fakes import (
@@ -131,6 +133,16 @@ def test_main_sets_up_the_screen_turns_off_drawing_and_binds_the_keys(
assert sorted(screens[0].bindings) == sorted(ARROW_KEYS)
def test_main_creates_data_txt_in_the_working_directory_holding_0(
monkeypatch: pytest.MonkeyPatch, sleeps: list[float], tmp_path: Path
) -> None:
install_fake_turtle(monkeypatch)
main()
assert (tmp_path / constants.HIGH_SCORE_FILE).read_text(encoding="utf-8") == "0"
def test_register_head_shape_builds_two_components_from_the_constants(
monkeypatch: pytest.MonkeyPatch,
) -> None: