mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 17:03:05 +02:00
- Added module docstrings to 19 Python files - Added class docstrings to 5 classes (ScreenLocker, PokerModifierApp, etc.) - Added method docstrings to 22 methods - Added function docstrings to 25 functions - Added __init__ docstrings to 5 classes - Removed D100-D107 from ruff ignore list (docstrings now enforced) - Removed deprecated ANN101, ANN102, UP038 rules from ignore list - Fixed UP038: use union types in isinstance() calls - All ruff checks now pass with full docstring enforcement
20 lines
565 B
Python
20 lines
565 B
Python
"""Tests for bot version management."""
|
|
|
|
from PYTHON.lichess_bot.utils import get_and_increment_version
|
|
|
|
|
|
def test_version_file_increments_and_persists(tmp_path, monkeypatch):
|
|
"""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"
|