Skip to content

Commit 470827b

Browse files
committed
this is why we have unit tests
1 parent e900903 commit 470827b

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

azure_functions_worker_v2/azure_functions_worker_v2/handle_event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ async def functions_metadata_request(request):
142142
logger.debug("Successfully completed WorkerMetadataRequest.")
143143
return protos.FunctionMetadataResponse(
144144
use_default_metadata_indexing=False,
145-
function__metadata_results=_metadata_result,
145+
function_metadata_results=_metadata_result,
146146
result=protos.StatusResult(
147147
status=protos.StatusResult.Success))
148148

azure_functions_worker_v2/pyproject.toml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,7 @@ Repository = "https://github.com/Azure/azure-functions-python-worker"
3333

3434
[project.optional-dependencies]
3535
dev = [
36-
"azure-eventhub", # Used for EventHub E2E tests
37-
"azure-functions-durable", # Used for Durable E2E tests
3836
"azure-monitor-opentelemetry", # Used for Azure Monitor unit tests
39-
"flask",
40-
"fastapi~=0.103.2",
41-
"pydantic",
42-
"pycryptodome==3.*",
4337
"flake8==6.*",
4438
"mypy",
4539
"pytest",
@@ -54,13 +48,6 @@ dev = [
5448
"pytest-instafail",
5549
"pytest-rerunfailures",
5650
"pytest-asyncio",
57-
"ptvsd",
58-
"python-dotenv",
59-
"plotly",
60-
"scikit-learn",
61-
"opencv-python",
62-
"pandas",
63-
"numpy",
6451
"pre-commit",
6552
"invoke"
6653
]

azure_functions_worker_v2/tests/unittests/test_handle_event.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,16 @@ async def test_worker_init_request_with_exception(self):
116116

117117
async def test_functions_metadata_request(self):
118118
handle_event.protos = test_protos
119-
handle_event.metadata_exception = None
119+
handle_event._metadata_exception = None
120120
metadata_result = await functions_metadata_request(None)
121121
self.assertEqual(metadata_result.result.status, 1)
122122

123123
async def test_functions_metadata_request_with_exception(self):
124124
handle_event.protos = test_protos
125-
handle_event.metadata_exception = Exception
125+
handle_event._metadata_exception = Exception
126126
metadata_result = await functions_metadata_request(None)
127127
self.assertEqual(metadata_result.result.status, 0)
128-
handle_event.metadata_exception = None
128+
handle_event._metadata_exception = None
129129

130130
@patch("azure_functions_worker_v2.loader.index_function_app",
131131
return_value=True)

0 commit comments

Comments
 (0)