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

Function test_add_rows

tests/test_data_table.py:207–218  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

205
206
207async def test_add_rows():
208 app = DataTableApp()
209 async with app.run_test():
210 table = app.query_one(DataTable)
211 table.add_columns("A", "B")
212 row_keys = table.add_rows(ROWS)
213 # We're given a key for each row
214 assert len(row_keys) == len(ROWS)
215 assert len(row_keys) == len(table._data)
216 assert table.row_count == len(ROWS)
217 # Each key can be used to fetch a row from the DataTable
218 assert all(key in table._data for key in row_keys)
219
220
221async def test_add_rows_user_defined_keys():

Callers

nothing calls this directly

Calls 5

DataTableAppClass · 0.85
run_testMethod · 0.80
query_oneMethod · 0.80
add_columnsMethod · 0.80
add_rowsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…