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

Function test_add_column_with_width

tests/test_data_table.py:280–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

278
279
280async def test_add_column_with_width():
281 app = DataTableApp()
282 async with app.run_test():
283 table = app.query_one(DataTable)
284 column = table.add_column("ABC", width=10, key="ABC")
285 row = table.add_row("123")
286 assert table.get_cell(row, column) == "123"
287 assert table.columns[column].width == 10
288 assert (
289 table.columns[column].get_render_width(table)
290 == 10 + 2 * _DEFAULT_CELL_X_PADDING
291 )
292
293
294async def test_add_columns():

Callers

nothing calls this directly

Calls 7

DataTableAppClass · 0.85
run_testMethod · 0.80
query_oneMethod · 0.80
add_columnMethod · 0.80
add_rowMethod · 0.80
get_cellMethod · 0.80
get_render_widthMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…