Skip to content

Commit ee43db3

Browse files
committed
Added unit tests
1 parent 3c4f56d commit ee43db3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/unittests/test_utilities.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from unittest.mock import patch
77
import typing
88

9-
from azure_functions_worker.utils import common, wrappers
9+
from azure_functions_worker.utils import common, wrappers, library_importer
1010

1111

1212
TEST_APP_SETTING_NAME = "TEST_APP_SETTING_NAME"
@@ -367,3 +367,14 @@ def _unset_feature_flag(self):
367367
os.environ.pop(TEST_FEATURE_FLAG)
368368
except KeyError:
369369
pass
370+
371+
def test_library_importer_invalid_import(self):
372+
sys.path.clear()
373+
sys.modules.pop('azure.functions')
374+
sys.path.insert(0, self._dummy_sdk_sys_path)
375+
common.get_sdk_from_sys_path()
376+
functionapp = library_importer.get_azure_function_app()
377+
self.assertIsNone(functionapp)
378+
379+
function = library_importer.get_azure_function_app()
380+
self.assertIsNone(function)

0 commit comments

Comments
 (0)