testsAndMisc/PYTHON/lichess_bot/tests/test_versioning.py
Krzysztof kuhy Rudnicki e3f9e6dc0b fix: correct shebang and executable permissions
- Add +x to Python scripts with shebangs (3 files)
- Remove -x from non-script files like .cpp, .txt, makefile (23 files)
- Move shebang to first line in C/imageViewer/lint.sh
2025-11-30 13:42:16 +01:00

17 lines
463 B
Python

from PYTHON.lichess_bot.utils import get_and_increment_version
def test_version_file_increments_and_persists(tmp_path, monkeypatch):
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"