Testing case where you try to update cells which dont exist

This commit is contained in:
Darren Burns
2023-02-01 17:34:03 +00:00
parent 23a34030cd
commit 77b94b005c
2 changed files with 21 additions and 1 deletions

View File

@@ -303,6 +303,16 @@ async def test_update_cell_cell_exists():
assert table.get_cell_value("1", "A") == "NEW_VALUE"
async def test_update_cell_cell_doesnt_exist():
app = DataTableApp()
async with app.run_test():
table = app.query_one(DataTable)
table.add_column("A", key="A")
table.add_row("1", key="1")
with pytest.raises(CellDoesNotExist):
table.update_cell("INVALID", "CELL", "Value")
# TODO: Test update coordinate