mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-11 14:27:40 +01:00
Temperature bound test: assert the default is at most 5 s, not exactly 5 s
The original only bounded the elapsed time, so == 5.0 was stricter than the requirement it replaced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f04b0d0efd
commit
8b0fb81d7b
@ -138,11 +138,13 @@ class TestNothingEscapesTheFetch:
|
|||||||
def test_the_whole_check_is_bounded_by_the_hard_timeout(self) -> None:
|
def test_the_whole_check_is_bounded_by_the_hard_timeout(self) -> None:
|
||||||
"""The user's requirement: at most 5s, then lock regardless.
|
"""The user's requirement: at most 5s, then lock regardless.
|
||||||
|
|
||||||
The bound is the default argument, so it is pinned to 5s here and the
|
The bound is the default argument, so it is pinned to at most 5s here
|
||||||
mechanism is timed at 0.1s: the same guarantee without 5 real seconds.
|
and the mechanism is timed at 0.1s: the same guarantee without 5 real
|
||||||
|
seconds.
|
||||||
"""
|
"""
|
||||||
default = signature(fetch_current_temp_with_status).parameters["hard_timeout"]
|
default = signature(fetch_current_temp_with_status).parameters["hard_timeout"]
|
||||||
assert default.default == HARD_TIMEOUT_SECONDS == 5.0
|
assert default.default == HARD_TIMEOUT_SECONDS
|
||||||
|
assert HARD_TIMEOUT_SECONDS <= 5.0
|
||||||
hang = threading.Event()
|
hang = threading.Event()
|
||||||
with patch(
|
with patch(
|
||||||
"screen_locker._temperature._fetch_current_temp_celsius_unbounded",
|
"screen_locker._temperature._fetch_current_temp_celsius_unbounded",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user