MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_get_age_seconds

Method test_get_age_seconds

ci/util/test_pio_package_messages.py:227–237  ·  view source on GitHub ↗

Test getting age of status.

(self)

Source from the content-addressed store, hash-verified

225 assert stale_status.is_stale(timeout_seconds=30)
226
227 def test_get_age_seconds(self):
228 """Test getting age of status."""
229 now = time.time()
230 status = DaemonStatus(
231 state=DaemonState.IDLE,
232 message="Ready",
233 updated_at=now - 10, # 10 seconds ago
234 )
235
236 age = status.get_age_seconds()
237 assert age >= 10.0 # Should be at least 10 seconds
238
239
240class TestDaemonState:

Callers

nothing calls this directly

Calls 3

get_age_secondsMethod · 0.95
DaemonStatusClass · 0.90
timeMethod · 0.80

Tested by

no test coverage detected