diff --git a/CLAUDE.md b/CLAUDE.md index 317ae19..86d1dbe 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -18,9 +18,9 @@ docker-compose up --build docker-compose down -v # also drops the pg volume — needed after a schema change # Tests -python -m unittest tests -v # pure-engine unittest (no deps) -python -m unittest tests_history -v # persistence + auth (needs sqlalchemy/aiosqlite/pyotp) -python -m unittest tests.StashCase.test_get_winner # single method +python -m unittest tests.test_engine -v # pure-engine unittest (no deps) +python -m unittest tests.test_history -v # persistence + auth (needs sqlalchemy/aiosqlite/pyotp) +python -m unittest tests.test_engine.StashCase.test_get_winner # single method ``` There is no linter or build step configured. The frontend is **only ever run via Docker** — never `npm install`/`npm run dev` on the host. @@ -31,7 +31,7 @@ Three independent layers, each usable without the one above it: **engine** (`bri ### Game engine — `bridzik.py` -Pure Python, **no Flask/Socket.IO/DB dependency**. All game rules live here and are exercised directly by `tests.py`. State is a strict nested hierarchy, each level enforcing turn order and completion before delegating down: +Pure Python, **no Flask/Socket.IO/DB dependency**. All game rules live here and are exercised directly by `tests/test_engine.py`. State is a strict nested hierarchy, each level enforcing turn order and completion before delegating down: - **`Bridzik`** — a whole game = exactly **4 `Series`**. - **`Series`** — exactly **8 `Round`s**; the starting player rotates per series/round. @@ -75,6 +75,6 @@ React + Vite PWA (zustand store, react-router, socket.io-client, `qrcode.react`) ## Conventions -- New game-rule logic belongs in `bridzik.py` with a `unittest` case in `tests.py` — keep the engine free of Flask/Socket.IO/DB. -- Persistence/auth logic goes in `db/` (data primitives) and `api/history.py` + `api/auth.py` (logic that uses them); cover it in `tests_history.py`, not `tests.py`. +- New game-rule logic belongs in `bridzik.py` with a `unittest` case in `tests/test_engine.py` — keep the engine free of Flask/Socket.IO/DB. +- Persistence/auth logic goes in `db/` (data primitives) and `api/history.py` + `api/auth.py` (logic that uses them); cover it in `tests/test_history.py`, not `tests/test_engine.py`. - Raise `BridzikException` (Slovak message) for rule violations; the API catches it and re-emits a Slovak error. Auth errors use `AuthError` the same way. diff --git a/config.py b/config.py deleted file mode 100644 index 7936e05..0000000 --- a/config.py +++ /dev/null @@ -1,2 +0,0 @@ -class Config(object): - SECRET_KEY = 'nbusr123' diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests.py b/tests/test_engine.py similarity index 100% rename from tests.py rename to tests/test_engine.py diff --git a/tests_history.py b/tests/test_history.py similarity index 100% rename from tests_history.py rename to tests/test_history.py diff --git a/test_socket.py b/tests/test_socket.py similarity index 100% rename from test_socket.py rename to tests/test_socket.py