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

Function test_set_length

tests/test_text.py:297–313  ·  tests/test_text.py::test_set_length
()

Source from the content-addressed store, hash-verified

295
296
297def test_set_length():
298 text = Text(class="st">"Hello")
299 text.set_length(5)
300 assert text == Text(class="st">"Hello")
301
302 text = Text(class="st">"Hello")
303 text.set_length(10)
304 assert text == Text(class="st">"Hello ")
305
306 text = Text(class="st">"Hello World")
307 text.stylize(class="st">"bold", 0, 5)
308 text.stylize(class="st">"italic", 7, 9)
309
310 text.set_length(3)
311 expected = Text()
312 expected.append(class="st">"Hel", class="st">"bold")
313 assert text == expected
314
315
316def test_console_width():

Callers

nothing calls this directly

Calls 4

set_lengthMethod · 0.95
stylizeMethod · 0.95
appendMethod · 0.95
TextClass · 0.90

Tested by

no test coverage detected