Skip to content

Commit 360ceeb

Browse files
committed
add tests
1 parent 1fd70cc commit 360ceeb

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

tests/integration/test_agent_workflows.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ def test_agent_workflow_with_retry(self):
189189
from sentience.models import ActionResult
190190

191191
mock_snapshot.return_value = create_mock_snapshot()
192-
# First call fails, second succeeds
192+
# First call raises exception (triggers retry), second succeeds
193193
mock_click.side_effect = [
194-
ActionResult(success=False, duration_ms=100, outcome="error"),
194+
RuntimeError("Element not found"),
195195
ActionResult(success=True, duration_ms=150, outcome="dom_updated"),
196196
]
197197

@@ -232,7 +232,7 @@ def test_agent_workflow_finish_action(self):
232232
llm = MockLLMProvider(responses=["FINISH()"])
233233
agent = SentienceAgent(browser, llm, verbose=False)
234234

235-
with patch("sentience.snapshot.snapshot") as mock_snapshot:
235+
with patch("sentience.agent.snapshot") as mock_snapshot:
236236
mock_snapshot.return_value = create_mock_snapshot()
237237

238238
result = agent.act("Task is complete", max_retries=0)
@@ -421,4 +421,3 @@ def test_agent_step_count_increments(self):
421421

422422
agent.act("Second action", max_retries=0)
423423
assert agent._step_count == initial_count + 2
424-

tests/test_utils_browser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,3 @@ def test_save_storage_state_prints_success_message(self, capsys):
149149
assert "✅" in captured.out
150150
assert "Saved storage state" in captured.out
151151
assert str(file_path) in captured.out
152-

0 commit comments

Comments
 (0)