v2.2.4: implement auto_overtime + overtime_unit + notif_before_minutes; remove 3 dead settings
Implemented (previously UI-only with no business effect): - auto_overtime: when OFF, prompt user on clock-out before banking - overtime_unit: 15/30/60-min truncation choice now actually applied - notification_before_minutes: 30-min hardcode -> user-configurable 1~120 Removed dead keys (no readers in business logic): - auto_detect_boot, notification_enabled, annual_leave_used Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
b91b229731
commit
14d88656fe
+29
-1
@@ -8,7 +8,10 @@ import pytest
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from utils.updater_client import _parse_version, is_newer, RELEASES_API
|
||||
from utils.updater_client import (
|
||||
_parse_version, is_newer, RELEASES_API,
|
||||
UP_TO_DATE, NETWORK_ERROR, NO_RELEASE, NO_ASSET,
|
||||
)
|
||||
|
||||
|
||||
class TestVersionParsing:
|
||||
@@ -59,6 +62,31 @@ class TestApiUrl:
|
||||
importlib.reload(updater_client)
|
||||
|
||||
|
||||
class TestCheckForUpdate:
|
||||
"""check_for_update returns (info, reason) tuple."""
|
||||
|
||||
def test_returns_tuple(self, monkeypatch):
|
||||
# 네트워크 호출이 실패하도록 잘못된 URL
|
||||
monkeypatch.setenv('CLOCKOUT_RELEASES_API', 'http://127.0.0.1:1/nope')
|
||||
import importlib
|
||||
from utils import updater_client
|
||||
importlib.reload(updater_client)
|
||||
try:
|
||||
result = updater_client.check_for_update('1.0.0', timeout=1)
|
||||
assert isinstance(result, tuple) and len(result) == 2
|
||||
info, reason = result
|
||||
assert info is None
|
||||
assert reason == updater_client.NETWORK_ERROR
|
||||
finally:
|
||||
monkeypatch.delenv('CLOCKOUT_RELEASES_API', raising=False)
|
||||
importlib.reload(updater_client)
|
||||
|
||||
def test_constants_distinct(self):
|
||||
# 4개 상수가 모두 서로 다른 값
|
||||
values = {UP_TO_DATE, NETWORK_ERROR, NO_RELEASE, NO_ASSET}
|
||||
assert len(values) == 4
|
||||
|
||||
|
||||
class TestUpdaterScript:
|
||||
"""updater.py 자체 로직."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user