diff --git a/src/device/tests/test_unitary_openconfig.py b/src/device/tests/test_unitary_openconfig.py index 47bea7ef68475c8b447b52d234d8ab44fa4ab684..32fb5709a98d095982d46d16450117a84f89f165 100644 --- a/src/device/tests/test_unitary_openconfig.py +++ b/src/device/tests/test_unitary_openconfig.py @@ -88,8 +88,9 @@ def test_device_openconfig_add_correct( device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' ] LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) @@ -135,8 +136,9 @@ def test_device_openconfig_configure( device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' ] LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) @@ -276,7 +278,7 @@ def test_device_openconfig_deconfigure( device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) for config_rule in device_data.device_config.config_rules if config_rule.WhichOneof('config_rule') == 'custom' ]