MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / test_console_clear

Function test_console_clear

tests/integration/test_api_drivers.py:37–49  ·  view source on GitHub ↗

Ensure console.clear resets the console buffer.

(api_client, device_simulator, clean_state)

Source from the content-addressed store, hash-verified

35
36@pytest.mark.integration
37def test_console_clear(api_client, device_simulator, clean_state):
38 """Ensure console.clear resets the console buffer."""
39 api_client.configure_network(host="127.0.0.1", port=9000, socket_type="tcp")
40 api_client.connect_device()
41 assert device_simulator.wait_for_connection(timeout=5.0)
42
43 device_simulator.send_frame(b"console test\n")
44 length = _wait_for_console_length(api_client, minimum=1)
45 assert length > 0, "Console buffer should contain data"
46
47 api_client.command("console.clear")
48 length = _wait_for_console_empty(api_client, timeout=2.0)
49 assert length == 0, "Console buffer should be empty"
50
51
52@pytest.mark.integration

Callers

nothing calls this directly

Calls 7

_wait_for_console_lengthFunction · 0.85
_wait_for_console_emptyFunction · 0.85
configure_networkMethod · 0.80
connect_deviceMethod · 0.80
commandMethod · 0.80
wait_for_connectionMethod · 0.45
send_frameMethod · 0.45

Tested by

no test coverage detected