Skip to content

Commit b34047f

Browse files
committed
fix tests
1 parent 6f33403 commit b34047f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

azure_functions_worker_v2/tests/unittests/test_handle_event.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ async def test_worker_init_request_with_otel(self,
9393
self.assertIsNotNone(result.worker_metadata.worker_bitness)
9494
self.assertEqual(result.result.status, 1)
9595

96-
async def test_worker_init_request_with_exception(self):
96+
@patch("azure_functions_worker_v2.handle_event"
97+
".otel_manager.get_azure_monitor_available",
98+
return_value=False)
99+
async def test_worker_init_request_with_exception(self,
100+
mock_otel_enabled):
97101
# If an exception happens during indexing, we return failure
98102
worker_request = WorkerRequest(name='worker_init_request',
99103
request=Request(FunctionRequest(

workers/tests/unittest_proxy/test_dispatcher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ async def test_handle_function_load_request(mock_logger, mock_streaming):
225225

226226
assert result == "mocked_stream_response"
227227
mock_logger.info.assert_called_with(
228-
'Received WorkerLoadRequest, request ID %s, function_id: %s,function_name: %s, '
229-
'worker_id: %s', "req789", "func123", "hello_function", "worker123"
228+
'Received WorkerLoadRequest, request ID %s, function_id: %s, function_name: %s,'
229+
' worker_id: %s', "req789", "func123", "hello_function", "worker123"
230230
)
231231

232232

@@ -250,7 +250,7 @@ async def test_handle_invocation_request(mock_logger, mock_streaming):
250250

251251
assert result == "mocked_streaming_response"
252252
mock_logger.info.assert_called_with(
253-
'Received FunctionInvocationRequest, request ID %s, function_id: %s,'
253+
'Received FunctionInvocationRequest, request ID %s, function_id: %s, '
254254
'invocation_id: %s, worker_id: %s',
255255
"req789", "func123", "inv123", "worker123"
256256
)

0 commit comments

Comments
 (0)