MCPcopy
hub / github.com/Textualize/rich / MockClock

Class MockClock

tests/test_progress.py:36–51  ·  view source on GitHub ↗

A clock that is manually advanced.

Source from the content-addressed store, hash-verified

34
35
36class MockClock:
37 """A clock that is manually advanced."""
38
39 def __init__(self, time=0.0, auto=True) -> None:
40 self.time = time
41 self.auto = auto
42
43 def __call__(self) -> float:
44 try:
45 return self.time
46 finally:
47 if self.auto:
48 self.time += 1
49
50 def tick(self, advance: float = 1) -> None:
51 self.time += advance
52
53
54def test_bar_columns():

Callers 3

test_trackFunction · 0.85
test_progress_trackFunction · 0.85
test_columnsFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_trackFunction · 0.68
test_progress_trackFunction · 0.68
test_columnsFunction · 0.68