Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ FakeClock
Class
FakeClock
tests/lib/test_credentials.py:1521–1526 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1519
1520
1521
class
FakeClock:
1522
def
__init__(self, now: float = 1000.0) -> None:
1523
self.now = now
1524
1525
def
__call__(self) -> float:
1526
return
self.now
1527
1528
1529
class
CountingProvider:
Callers
15
test_first_call_fetches
Method · 0.85
test_no_expiry_never_refreshes
Method · 0.85
test_fresh_token_not_refetched
Method · 0.85
test_advisory_refresh_success
Method · 0.85
test_advisory_refresh_failure_serves_stale
Method · 0.85
test_mandatory_refresh_failure_raises
Method · 0.85
test_expired_is_mandatory
Method · 0.85
test_expired_but_nonzero_expiry_keeps_single_flight
Method · 0.85
test_zero_expiry_token_is_not_reused
Method · 0.85
test_advisory_caller_skips_when_refresh_in_flight
Method · 0.85
test_late_per_request_result_does_not_replace_cached_expiring_token
Method · 0.85
test_advisory_refresh_backoff_after_failure
Method · 0.85
Calls
no outgoing calls
Tested by
15
test_first_call_fetches
Method · 0.68
test_no_expiry_never_refreshes
Method · 0.68
test_fresh_token_not_refetched
Method · 0.68
test_advisory_refresh_success
Method · 0.68
test_advisory_refresh_failure_serves_stale
Method · 0.68
test_mandatory_refresh_failure_raises
Method · 0.68
test_expired_is_mandatory
Method · 0.68
test_expired_but_nonzero_expiry_keeps_single_flight
Method · 0.68
test_zero_expiry_token_is_not_reused
Method · 0.68
test_advisory_caller_skips_when_refresh_in_flight
Method · 0.68
test_late_per_request_result_does_not_replace_cached_expiring_token
Method · 0.68
test_advisory_refresh_backoff_after_failure
Method · 0.68