from __future__ import annotations from datetime import UTC, datetime import pytest from vuln_scan.core.time import Clock, FixedClock def test_clock_now_returns_utc_datetime() -> None: now = Clock().now() assert isinstance(now, datetime) assert now.tzinfo is UTC @pytest.mark.parametrize( "fixed_dt", [ pytest.param(datetime(2026, 3, 25, 12, 30, tzinfo=UTC), id="future-date"), pytest.param(datetime(2024, 1, 1, 0, 0, tzinfo=UTC), id="past-date"), ], ) def test_fixed_clock_returns_stable_exact_datetime(fixed_dt: datetime) -> None: clock = FixedClock(fixed_dt) assert clock.now() == fixed_dt assert clock.now() == clock.now()