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

Function test_update_cell_at_column_width

tests/test_data_table.py:751–768  ·  view source on GitHub ↗
(label, new_value, new_content_width)

Source from the content-addressed store, hash-verified

749 ],
750)
751async def test_update_cell_at_column_width(label, new_value, new_content_width):
752 # Initial cell values are length 3. Let's update cell content and ensure
753 # that the width of the column is correct given the new cell content widths
754 # and the label of the column the cell is in.
755 app = DataTableApp()
756 async with app.run_test():
757 table = app.query_one(DataTable)
758 key, _ = table.add_columns(label, "Column2")
759 table.add_rows(ROWS)
760 first_column = table.columns.get(key)
761
762 table.update_cell_at(Coordinate(0, 0), new_value, update_width=True)
763 await wait_for_idle()
764 assert first_column.content_width == new_content_width
765 assert (
766 first_column.get_render_width(table)
767 == new_content_width + 2 * _DEFAULT_CELL_X_PADDING
768 )
769
770
771async def test_coordinate_to_cell_key():

Callers

nothing calls this directly

Calls 10

CoordinateClass · 0.90
wait_for_idleFunction · 0.90
DataTableAppClass · 0.85
run_testMethod · 0.80
query_oneMethod · 0.80
add_columnsMethod · 0.80
add_rowsMethod · 0.80
update_cell_atMethod · 0.80
get_render_widthMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…