MCPcopy
hub / github.com/Textualize/textual / test_initial_column_widths

Function test_initial_column_widths

tests/test_data_table.py:426–442  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

424
425
426async def test_initial_column_widths() -> None:
427 app = DataTableApp()
428 async with app.run_test():
429 table = app.query_one(DataTable)
430 foo, bar = table.add_columns("foo", "bar")
431
432 assert table.columns[foo].width == 3
433 assert table.columns[bar].width == 3
434 table.add_row("Hello", "World!")
435 await wait_for_idle()
436 assert table.columns[foo].content_width == 5
437 assert table.columns[bar].content_width == 6
438
439 table.add_row("Hello World!!!", "fo")
440 await wait_for_idle()
441 assert table.columns[foo].content_width == 14
442 assert table.columns[bar].content_width == 6
443
444
445async def test_get_cell_returns_value_at_cell():

Callers

nothing calls this directly

Calls 6

wait_for_idleFunction · 0.90
DataTableAppClass · 0.85
run_testMethod · 0.80
query_oneMethod · 0.80
add_columnsMethod · 0.80
add_rowMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…