Test 4: Adding multiple columns one at a time
()
| 319 | |
| 320 | @pytest.mark.asyncio |
| 321 | async def test_add_multiple_columns(): |
| 322 | """Test 4: Adding multiple columns one at a time""" |
| 323 | wrapper = XtopTUIWrapper( |
| 324 | datadir=XCAPTURE_DATADIR, |
| 325 | initial_group_cols=['state'] |
| 326 | ) |
| 327 | app = wrapper.create_app() |
| 328 | |
| 329 | async with app.run_test(size=(120, 40)) as pilot: |
| 330 | await pilot.pause() |
| 331 | await wait_for_table_load(pilot) |
| 332 | |
| 333 | # Get initial column count |
| 334 | initial_cols, _ = get_table_data(app) |
| 335 | initial_count = len(initial_cols) |
| 336 | print(f"Starting with {initial_count} columns: {initial_cols}") |
| 337 | |
| 338 | # Add first column (USERNAME) |
| 339 | await select_single_column_in_grouping(pilot, 'USERNAME') |
| 340 | await pilot.pause() |
| 341 | await wait_for_table_load(pilot) |
| 342 | |
| 343 | # Check column count increased |
| 344 | cols_after_first, _ = get_table_data(app) |
| 345 | if len(cols_after_first) <= initial_count: |
| 346 | raise AssertionError(f"Failed to add first column. Before: {initial_cols}, After: {cols_after_first}") |
| 347 | |
| 348 | print(f"After first addition: {len(cols_after_first)} columns") |
| 349 | |
| 350 | # Add second column (EXE) |
| 351 | await select_single_column_in_grouping(pilot, 'EXE') |
| 352 | await pilot.pause() |
| 353 | await wait_for_table_load(pilot) |
| 354 | |
| 355 | # Check column count increased again |
| 356 | final_cols, _ = get_table_data(app) |
| 357 | if len(final_cols) <= len(cols_after_first): |
| 358 | raise AssertionError(f"Failed to add second column. Before: {cols_after_first}, After: {final_cols}") |
| 359 | |
| 360 | print(f"✓ Test 4 passed: Added multiple columns. Final: {len(final_cols)} columns") |
| 361 | |
| 362 | |
| 363 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected