MCPcopy Create free account
hub / github.com/IBM/mcp-cli / fake_time

Function fake_time

tests/tools/test_execution.py:699–709  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

697 call_count = 0
698
699 def fake_time():
700 nonlocal call_count
701 call_count += 1
702 if call_count <= 2:
703 # First call: sets deadline = real_time + 1000
704 # Second call: first remaining = 1000 - real_time ≈ 1000 (positive)
705 return real_time
706 else:
707 # All subsequent calls: pretend the clock has jumped far past the
708 # deadline so remaining ≤ 0 triggers.
709 return real_time + 100_000
710
711 results = []
712 with mock.patch.object(real_loop, "time", side_effect=fake_time):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected