Test to ensure correct exception raised when converting to cell key from coordinate in DataTable

This commit is contained in:
Darren Burns
2023-02-02 15:44:25 +00:00
parent 18aaeaa284
commit 998ee9b8a2

View File

@@ -379,6 +379,14 @@ async def test_coordinate_to_cell_key():
assert cell_key == CellKey(row_key, column_key) assert cell_key == CellKey(row_key, column_key)
async def test_coordinate_to_cell_key_invalid_coordinate():
app = DataTableApp()
async with app.run_test():
table = app.query_one(DataTable)
with pytest.raises(CellDoesNotExist):
table.coordinate_to_cell_key(Coordinate(9999, 9999))
def test_key_equals_equivalent_string(): def test_key_equals_equivalent_string():
text = "Hello" text = "Hello"
key = RowKey(text) key = RowKey(text)