From 479e44e95b7b66aec7b3e2a5d67642dc4fb85ddb Mon Sep 17 00:00:00 2001 From: Ekin Dursun Date: Thu, 6 Jun 2024 22:12:25 +0300 Subject: [PATCH] Remove all occurences of assertDictContainsSubset --- .../cli/core/tests/test_command_registration.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/azure-cli-core/azure/cli/core/tests/test_command_registration.py b/src/azure-cli-core/azure/cli/core/tests/test_command_registration.py index 6e96ef57f13..9e695839b8a 100644 --- a/src/azure-cli-core/azure/cli/core/tests/test_command_registration.py +++ b/src/azure-cli-core/azure/cli/core/tests/test_command_registration.py @@ -93,8 +93,8 @@ def load_arguments(self, command): } for probe in some_expected_arguments: existing = next(arg for arg in command_metadata.arguments if arg == probe) - self.assertDictContainsSubset(some_expected_arguments[existing].settings, - command_metadata.arguments[existing].options) + self.assertLessEqual(some_expected_arguments[existing].settings.items(), + command_metadata.arguments[existing].options.items()) self.assertEqual(command_metadata.arguments['vm_name'].options_list, ('--wonky-name', '-n')) def test_register_command(self): @@ -137,8 +137,8 @@ def load_arguments(self, command): for probe in some_expected_arguments: existing = next(arg for arg in command_metadata.arguments if arg == probe) - self.assertDictContainsSubset(some_expected_arguments[existing].settings, - command_metadata.arguments[existing].options) + self.assertLessEqual(some_expected_arguments[existing].settings.items(), + command_metadata.arguments[existing].options.items()) self.assertEqual(command_metadata.arguments['resource_group_name'].options_list, ['--resource-group-name']) @@ -518,8 +518,8 @@ def load_arguments(self, command): for probe in some_expected_arguments: existing = next(arg for arg in command_metadata.arguments if arg == probe) - self.assertDictContainsSubset(some_expected_arguments[existing].settings, - command_metadata.arguments[existing].options) + self.assertLessEqual(some_expected_arguments[existing].settings.items(), + command_metadata.arguments[existing].options.items()) def test_command_build_argument_help_text(self): @@ -562,8 +562,8 @@ def load_command_table(self, args): for probe in some_expected_arguments: existing = next(arg for arg in command_metadata.arguments if arg == probe) - self.assertDictContainsSubset(some_expected_arguments[existing].settings, - command_metadata.arguments[existing].options) + self.assertLessEqual(some_expected_arguments[existing].settings.items(), + command_metadata.arguments[existing].options.items()) def test_override_existing_option_string(self): arg = CLIArgumentType(options_list=('--funky', '-f'))