Skip to content

Commit 810b53c

Browse files
committed
test: add even more tests for build to pass lol
Signed-off-by: Samantha Coyle <sam@diagrid.io>
1 parent 075f491 commit 810b53c

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

ext/dapr-ext-workflow/tests/test_workflow_runtime.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,29 @@ def test_start_succeeds_when_worker_ready(self):
223223
mock_worker.start.assert_called_once()
224224
mock_worker.is_worker_ready.assert_called()
225225

226+
def test_start_logs_debug_when_worker_stream_ready(self):
227+
"""start() logs at debug when worker and stream are ready."""
228+
mock_worker = mock.MagicMock()
229+
mock_worker.is_worker_ready.return_value = True
230+
self.runtime._WorkflowRuntime__worker = mock_worker
231+
with mock.patch.object(self.runtime._logger, 'debug') as mock_debug:
232+
self.runtime.start()
233+
mock_debug.assert_called_once()
234+
call_args = mock_debug.call_args[0][0]
235+
self.assertIn('ready', call_args)
236+
self.assertIn('stream', call_args)
237+
238+
def test_start_logs_exception_when_worker_start_fails(self):
239+
"""start() logs exception when worker.start() raises."""
240+
mock_worker = mock.MagicMock()
241+
mock_worker.start.side_effect = RuntimeError('start failed')
242+
self.runtime._WorkflowRuntime__worker = mock_worker
243+
with mock.patch.object(self.runtime._logger, 'exception') as mock_exception:
244+
with self.assertRaises(RuntimeError):
245+
self.runtime.start()
246+
mock_exception.assert_called_once()
247+
self.assertIn('did not start', mock_exception.call_args[0][0])
248+
226249
def test_start_raises_when_worker_not_ready(self):
227250
listActivities.clear()
228251
listOrchestrators.clear()

0 commit comments

Comments
 (0)