Skip to content

Commit 66fb7dd

Browse files
authored
Added consumption test for dependency isolation (#1063)
1 parent 083f800 commit 66fb7dd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/endtoend/test_linux_consumption.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,25 @@ def test_debug_logging_enabled(self):
203203
self.assertIn('logging error', func_log)
204204
self.assertIn('logging debug', func_log)
205205

206+
def test_pinning_functions_to_older_version(self):
207+
"""An HttpTrigger function app with 'azure-functions==1.11.1' library
208+
should return 200 with the azure functions version set to 1.11.1
209+
since dependency isolation is enabled by default for all py versions
210+
"""
211+
with LinuxConsumptionWebHostController(_DEFAULT_HOST_VERSION,
212+
self._py_version) as ctrl:
213+
214+
ctrl.assign_container(env={
215+
"AzureWebJobsStorage": self._storage,
216+
"SCM_RUN_FROM_PACKAGE": self._get_blob_url(
217+
"PinningFunctions"),
218+
})
219+
req = Request('GET', f'{ctrl.url}/api/HttpTrigger1')
220+
resp = ctrl.send_request(req)
221+
222+
self.assertEqual(resp.status_code, 200)
223+
self.assertIn("Func Version: 1.11.1", resp.text)
224+
206225
def _get_blob_url(self, scenario_name: str) -> str:
207226
return (
208227
f'https://pythonworker{self._py_shortform}sa.blob.core.windows.net/'

0 commit comments

Comments
 (0)