From 41e5179a184b675939d120b15589b5bfd7e3fbfd Mon Sep 17 00:00:00 2001 From: Victoria Litvinova <73560279+vilit1@users.noreply.github.com> Date: Wed, 7 Sep 2022 09:40:21 -0700 Subject: [PATCH] Pipeline fixes (#564) * force no sys identity * add quality of life + fix up init * central test fix --- azext_iot/tests/central/__init__.py | 3 ++- azext_iot/tests/central/test_iot_central_devices_int.py | 9 +++++---- azext_iot/tests/settings.py | 3 +++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/azext_iot/tests/central/__init__.py b/azext_iot/tests/central/__init__.py index 4f5a4fee6..d609b953d 100644 --- a/azext_iot/tests/central/__init__.py +++ b/azext_iot/tests/central/__init__.py @@ -141,11 +141,12 @@ def _create_app(self): # Create the min version app and assign the correct roles if not target_app: self.cmd( - "iot central app create -n {} -g {} -s {} --mi-system-assigned -l {}".format( + "iot central app create -n {} -g {} -s {} -l {}".format( self.app_id, APP_RG, self.app_id, "westus" ), include_opt_args=False, ) + self.app_primary_key = None # Will be repopulated with get_app_scope_id for tests that need it self._scope_id = None diff --git a/azext_iot/tests/central/test_iot_central_devices_int.py b/azext_iot/tests/central/test_iot_central_devices_int.py index 60f08bf48..abbf1ee4e 100644 --- a/azext_iot/tests/central/test_iot_central_devices_int.py +++ b/azext_iot/tests/central/test_iot_central_devices_int.py @@ -326,8 +326,8 @@ def test_central_device_module_properties_methods(self): api_version=self._api_version, device_id=device_id, module_name='testModule') - # Module properties update response is an empty object {} - assert update_device_properties == {} + assert update_device_properties['$metadata']['testFirstProperty']['desiredValue'] == 'updatedTestFirstProperty' + assert update_device_properties['$metadata']['testSecondProperty']['desiredValue'] == 'updatedTestSecondProperty' # Show module properties command = f''' @@ -346,8 +346,9 @@ def test_central_device_module_properties_methods(self): device_id=device_id, module_name='testModule', component_name='ModuleComponent') - # Module properties update response is an empty object {} - assert update_device_component_properties == {} + metadata = update_device_component_properties['$metadata'] + assert metadata['testComponentFirstProperty']['desiredValue'] == 'updatedTestComponentFirstProperty' + assert metadata['testComponentSecondProperty']['desiredValue'] == 'updatedTestComponentSecondProperty' # Show module component properties command = f''' diff --git a/azext_iot/tests/settings.py b/azext_iot/tests/settings.py index 3bd3e67d4..1a519bc78 100644 --- a/azext_iot/tests/settings.py +++ b/azext_iot/tests/settings.py @@ -55,6 +55,9 @@ def __init__(self, req_env_set: list = None, opt_env_set: list = None): def _build_config(self, env_set: list, optional: bool = False): for key in env_set: value = environ.get(key) + # Null out value if it is set to default pipeline value + if value == "sentinel": + value = None if not value: if not optional: raise RuntimeError(