Test 3: Adding a column to existing STATE grouping
()
| 284 | |
| 285 | @pytest.mark.asyncio |
| 286 | async def test_add_single_column(): |
| 287 | """Test 3: Adding a column to existing STATE grouping""" |
| 288 | wrapper = XtopTUIWrapper( |
| 289 | datadir=XCAPTURE_DATADIR, |
| 290 | initial_group_cols=['state'] |
| 291 | ) |
| 292 | app = wrapper.create_app() |
| 293 | |
| 294 | async with app.run_test(size=(120, 40)) as pilot: |
| 295 | await pilot.pause() |
| 296 | await wait_for_table_load(pilot) |
| 297 | |
| 298 | # Get initial columns |
| 299 | initial_cols, _ = get_table_data(app) |
| 300 | print(f"Initial columns: {initial_cols}") |
| 301 | |
| 302 | # Try to add USERNAME column (more likely to work in grouping) |
| 303 | await select_single_column_in_grouping(pilot, 'USERNAME') |
| 304 | |
| 305 | # Wait for query to execute |
| 306 | await pilot.pause() |
| 307 | await wait_for_table_load(pilot) |
| 308 | |
| 309 | # Get new columns |
| 310 | new_cols, _ = get_table_data(app) |
| 311 | print(f"New columns after adding USERNAME: {new_cols}") |
| 312 | |
| 313 | # Check if we have more columns than before |
| 314 | if len(new_cols) > len(initial_cols): |
| 315 | print("✓ Test 3 passed: Successfully added a column to grouping") |
| 316 | else: |
| 317 | raise AssertionError(f"Failed to add column. Initial: {initial_cols}, After: {new_cols}") |
| 318 | |
| 319 | |
| 320 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected