Test 3: Refresh command works
()
| 186 | |
| 187 | @pytest.mark.asyncio |
| 188 | async def test_refresh_command(): |
| 189 | """Test 3: Refresh command works""" |
| 190 | wrapper = XtopTUIWrapper( |
| 191 | datadir=XCAPTURE_DATADIR, |
| 192 | initial_group_cols=['state'] |
| 193 | ) |
| 194 | app = wrapper.create_app() |
| 195 | |
| 196 | async with app.run_test(size=(120, 40)) as pilot: |
| 197 | await pilot.pause(1.0) |
| 198 | await wait_for_app_ready(pilot) |
| 199 | |
| 200 | # Get initial data |
| 201 | initial_cols, initial_rows = get_table_data(app) |
| 202 | |
| 203 | # Press 'r' to refresh |
| 204 | await pilot.press("r") |
| 205 | await pilot.pause(2.0) # Wait for refresh |
| 206 | |
| 207 | # Get data after refresh |
| 208 | new_cols, new_rows = get_table_data(app) |
| 209 | |
| 210 | # Data should still be present after refresh |
| 211 | assert len(new_cols) > 0, "Should have columns after refresh" |
| 212 | assert new_rows > 0, "Should have rows after refresh" |
| 213 | |
| 214 | print(f"✓ Refresh works: {initial_rows} rows → {new_rows} rows") |
| 215 | |
| 216 | |
| 217 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected