WIP: PAIN
This commit is contained in:
@@ -50,12 +50,9 @@ def test_get_performance_success() -> None:
|
||||
client = ApiHookClient()
|
||||
with patch.object(client, '_make_request') as mock_make:
|
||||
mock_make.return_value = {"fps": 60.0}
|
||||
# In current impl, diagnostics might be retrieved via get_gui_state or dedicated method
|
||||
# Let's ensure the method exists if we test it.
|
||||
if hasattr(client, 'get_gui_diagnostics'):
|
||||
metrics = client.get_gui_diagnostics()
|
||||
assert metrics["fps"] == 60.0
|
||||
mock_make.assert_any_call('GET', '/api/gui/diagnostics')
|
||||
metrics = client.get_gui_diagnostics()
|
||||
assert metrics["fps"] == 60.0
|
||||
mock_make.assert_any_call('GET', '/api/gui/diagnostics')
|
||||
|
||||
def test_unsupported_method_error() -> None:
|
||||
"""Test that ApiHookClient handles unsupported HTTP methods gracefully"""
|
||||
@@ -67,11 +64,11 @@ def test_unsupported_method_error() -> None:
|
||||
def test_get_text_value() -> None:
|
||||
"""Test retrieval of string representation using get_text_value."""
|
||||
client = ApiHookClient()
|
||||
with patch.object(client, '_make_request') as mock_make:
|
||||
mock_make.return_value = {"value": "Hello World"}
|
||||
# Mock get_gui_state which is called by get_value
|
||||
with patch.object(client, 'get_gui_state') as mock_state:
|
||||
mock_state.return_value = {"some_label": "Hello World"}
|
||||
val = client.get_text_value("some_label")
|
||||
assert val == "Hello World"
|
||||
mock_make.assert_any_call('GET', '/api/gui/text/some_label')
|
||||
|
||||
def test_get_node_status() -> None:
|
||||
"""Test retrieval of DAG node status using get_node_status."""
|
||||
|
||||
Reference in New Issue
Block a user