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

Function test_set_length

tests/test_text.py:297–313  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

295
296
297def test_set_length():
298 text = Text("Hello")
299 text.set_length(5)
300 assert text == Text("Hello")
301
302 text = Text("Hello")
303 text.set_length(10)
304 assert text == Text("Hello ")
305
306 text = Text("Hello World")
307 text.stylize("bold", 0, 5)
308 text.stylize("italic", 7, 9)
309
310 text.set_length(3)
311 expected = Text()
312 expected.append("Hel", "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

Used in the wild real call sites across dependent graphs

searching dependent graphs…