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

Function test_get_pulse_segments

tests/test_bar.py:64–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62
63
64def test_get_pulse_segments():
65 bar = ProgressBar()
66 segments = bar._get_pulse_segments(
67 Style.parse("red"), Style.parse("yellow"), None, False, False
68 )
69 print(repr(segments))
70 expected = [
71 Segment("━", Style.parse("red")),
72 Segment("━", Style.parse("red")),
73 Segment("━", Style.parse("red")),
74 Segment("━", Style.parse("red")),
75 Segment("━", Style.parse("red")),
76 Segment("━", Style.parse("red")),
77 Segment("━", Style.parse("red")),
78 Segment("━", Style.parse("red")),
79 Segment("━", Style.parse("red")),
80 Segment("━", Style.parse("red")),
81 Segment("━", Style.parse("yellow")),
82 Segment("━", Style.parse("yellow")),
83 Segment("━", Style.parse("yellow")),
84 Segment("━", Style.parse("yellow")),
85 Segment("━", Style.parse("yellow")),
86 Segment("━", Style.parse("yellow")),
87 Segment("━", Style.parse("yellow")),
88 Segment("━", Style.parse("yellow")),
89 Segment("━", Style.parse("yellow")),
90 Segment("━", Style.parse("yellow")),
91 ]
92 assert segments == expected
93
94
95if __name__ == "__main__":

Callers

nothing calls this directly

Calls 5

_get_pulse_segmentsMethod · 0.95
ProgressBarClass · 0.90
SegmentClass · 0.90
printFunction · 0.50
parseMethod · 0.45

Tested by

no test coverage detected