MCPcopy
hub / github.com/tanelpoder/0xtools / test_tui_startup

Function test_tui_startup

xtop/tests/test_tui_basic.py:234–255  ·  view source on GitHub ↗

Test 1: TUI starts with only 'state' column in grouping

()

Source from the content-addressed store, hash-verified

232
233@pytest.mark.asyncio
234async def test_tui_startup():
235 """Test 1: TUI starts with only 'state' column in grouping"""
236 wrapper = XtopTUIWrapper(
237 datadir=XCAPTURE_DATADIR,
238 initial_group_cols=['state']
239 )
240 app = wrapper.create_app()
241
242 async with app.run_test(size=(120, 40)) as pilot:
243 await pilot.pause()
244 await wait_for_table_load(pilot)
245
246 # Verify table has data
247 table = app.query_one(DataTable)
248 row_count = len(list(table.rows))
249 assert row_count > 0, f"No data rows found"
250
251 # Check that 'state' column is present
252 columns, _ = get_table_data(app)
253 assert 'state' in [col.lower() for col in columns], "State column not found"
254
255 print(f"✓ Test 1 passed: TUI started with {row_count} rows, grouped by 'state'")
256
257
258@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 4

create_appMethod · 0.95
wait_for_table_loadFunction · 0.85
XtopTUIWrapperClass · 0.70
get_table_dataFunction · 0.70

Tested by

no test coverage detected