From 998ee9b8a217fd6204b39e08defca81cb8ca952a Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Thu, 2 Feb 2023 15:44:25 +0000 Subject: [PATCH] Test to ensure correct exception raised when converting to cell key from coordinate in DataTable --- tests/test_data_table.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_data_table.py b/tests/test_data_table.py index 49d490a06..1555646de 100644 --- a/tests/test_data_table.py +++ b/tests/test_data_table.py @@ -379,6 +379,14 @@ async def test_coordinate_to_cell_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(): text = "Hello" key = RowKey(text)