testsAndMisc/python_pkg/lichess_bot/tests/test_versioning.py
Krzysztof kuhy Rudnicki 2dd4e68edb refactor: rename folders to fix N999, INP001, S311 linting rules
- Rename PYTHON/ to python_pkg/ (fix N999 uppercase folder)
- Rename camelCase folders to snake_case:
  - randomJPG -> random_jpg
  - tagDivider -> tag_divider
  - downloadCats -> download_cats
  - keyboardCoop -> keyboard_coop
  - extractLinks -> extract_links
  - scapeWebsite -> scrape_website
- Rename camelCase files:
  - generateJpeg.py -> generate_jpeg.py
  - tagDivider.py -> tag_divider.py
- Rename poker-modifier-app to poker_modifier_app (fix INP001)
- Add __init__.py to poker_modifier_app
- Replace random module with secrets.SystemRandom (fix S311)
- Fix S110 try-except-pass with contextlib.suppress
- Update all imports and config references
2025-11-30 21:20:17 +01:00

26 lines
650 B
Python

"""Tests for bot version management."""
from pathlib import Path
import pytest
from python_pkg.lichess_bot.utils import get_and_increment_version
def test_version_file_increments_and_persists(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
"""Test that version increments and persists to file."""
version_file = tmp_path / "version.txt"
monkeypatch.setenv("LICHESS_BOT_VERSION_FILE", str(version_file))
v1 = get_and_increment_version()
v2 = get_and_increment_version()
assert v1 == 1
assert v2 == 2
# Ensure it persisted
with open(version_file) as f:
assert f.read().strip() == "2"