MCPcopy Index your code
hub / github.com/tanelpoder/0xtools / test_refresh_command

Function test_refresh_command

xtop/tests/test_tui_simple.py:188–214  ·  view source on GitHub ↗

Test 3: Refresh command works

()

Source from the content-addressed store, hash-verified

186
187@pytest.mark.asyncio
188async 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

Callers

nothing calls this directly

Calls 4

create_appMethod · 0.95
wait_for_app_readyFunction · 0.85
XtopTUIWrapperClass · 0.70
get_table_dataFunction · 0.70

Tested by

no test coverage detected