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

Function test_styled

tests/test_styled.py:8–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8def test_styled():
9 styled_foo = Styled("foo", "on red")
10 console = Console(file=io.StringIO(), force_terminal=True, _environ={})
11 assert Measurement.get(console, console.options, styled_foo) == Measurement(3, 3)
12 console.print(styled_foo)
13 result = console.file.getvalue()
14 expected = "\x1b[41mfoo\x1b[0m\n"
15 assert result == expected

Callers

nothing calls this directly

Calls 5

printMethod · 0.95
StyledClass · 0.90
ConsoleClass · 0.90
MeasurementClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected