test(sim): Setup framework for robust live sim verification
This commit is contained in:
@@ -63,3 +63,38 @@ def test_unsupported_method_error():
|
||||
client = ApiHookClient()
|
||||
with pytest.raises(ValueError, match="Unsupported HTTP method"):
|
||||
client._make_request('PUT', '/some_endpoint', data={'key': 'value'})
|
||||
|
||||
def test_get_text_value():
|
||||
"""
|
||||
Test retrieval of string representation using get_text_value.
|
||||
"""
|
||||
client = ApiHookClient()
|
||||
with patch.object(client, 'get_value', return_value=123):
|
||||
assert client.get_text_value("dummy_tag") == "123"
|
||||
|
||||
with patch.object(client, 'get_value', return_value=None):
|
||||
assert client.get_text_value("dummy_tag") is None
|
||||
|
||||
def test_get_node_status():
|
||||
"""
|
||||
Test retrieval of DAG node status using get_node_status.
|
||||
"""
|
||||
client = ApiHookClient()
|
||||
# When get_value returns a status directly
|
||||
with patch.object(client, 'get_value', return_value="running"):
|
||||
assert client.get_node_status("my_node") == "running"
|
||||
|
||||
# When get_value returns None and diagnostics provides a nodes dict
|
||||
with patch.object(client, 'get_value', return_value=None):
|
||||
with patch.object(client, '_make_request', return_value={'nodes': {'my_node': 'completed'}}):
|
||||
assert client.get_node_status("my_node") == "completed"
|
||||
|
||||
# When get_value returns None and diagnostics provides a direct key
|
||||
with patch.object(client, 'get_value', return_value=None):
|
||||
with patch.object(client, '_make_request', return_value={'my_node': 'failed'}):
|
||||
assert client.get_node_status("my_node") == "failed"
|
||||
|
||||
# When neither works
|
||||
with patch.object(client, 'get_value', return_value=None):
|
||||
with patch.object(client, '_make_request', return_value={}):
|
||||
assert client.get_node_status("my_node") is None
|
||||
|
||||
20
tests/visual_sim_mma_v2.py
Normal file
20
tests/visual_sim_mma_v2.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import pytest
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Ensure project root is in path
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
@pytest.mark.integration
|
||||
def test_mma_epic_simulation(live_gui):
|
||||
"""
|
||||
Integration test for MMA epic simulation.
|
||||
Red Phase: asserts False.
|
||||
"""
|
||||
client = ApiHookClient()
|
||||
assert client.wait_for_server(timeout=10)
|
||||
|
||||
assert False, "Red Phase: Not yet implemented"
|
||||
Reference in New Issue
Block a user