From 8c485f33916faaed58b6d7b1264c40b11b763046 Mon Sep 17 00:00:00 2001 From: Alan King Date: Mon, 5 Aug 2024 22:41:15 -0400 Subject: [PATCH] [#118] Replace assertEquals with assertEqual in tests unittest.assertEquals was deprecated as an alias of unittest.assertEqual in python 3.2. The alias was removed in python 3.12. This commit replaces the use of the deprecated / removed alias with the proper method name. --- .../test_rule_engine_plugin_logical_quotas.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packaging/test_rule_engine_plugin_logical_quotas.py b/packaging/test_rule_engine_plugin_logical_quotas.py index a1eca7e..e526604 100644 --- a/packaging/test_rule_engine_plugin_logical_quotas.py +++ b/packaging/test_rule_engine_plugin_logical_quotas.py @@ -563,10 +563,10 @@ def test_adding_duplicate_attribute_names_with_different_values_or_units_is_not_ # Assert that the quota values are what we expect them to be. values = self.get_logical_quotas_attribute_values(col, include_max_values=True) - self.assertEquals(values[self.maximum_number_of_data_objects_attribute()], 10) - self.assertEquals(values[self.maximum_size_in_bytes_attribute()], 1000) - self.assertEquals(values[self.total_number_of_data_objects_attribute()], 0) - self.assertEquals(values[self.total_size_in_bytes_attribute()], 0) + self.assertEqual(values[self.maximum_number_of_data_objects_attribute()], 10) + self.assertEqual(values[self.maximum_size_in_bytes_attribute()], 1000) + self.assertEqual(values[self.total_number_of_data_objects_attribute()], 0) + self.assertEqual(values[self.total_size_in_bytes_attribute()], 0) expected_output = ['-169000 SYS_NOT_ALLOWED'] @@ -584,10 +584,10 @@ def test_adding_duplicate_attribute_names_with_different_values_or_units_is_not_ # Show that the quota values have not changed. values = self.get_logical_quotas_attribute_values(col, include_max_values=True) - self.assertEquals(values[self.maximum_number_of_data_objects_attribute()], 10) - self.assertEquals(values[self.maximum_size_in_bytes_attribute()], 1000) - self.assertEquals(values[self.total_number_of_data_objects_attribute()], 0) - self.assertEquals(values[self.total_size_in_bytes_attribute()], 0) + self.assertEqual(values[self.maximum_number_of_data_objects_attribute()], 10) + self.assertEqual(values[self.maximum_size_in_bytes_attribute()], 1000) + self.assertEqual(values[self.total_number_of_data_objects_attribute()], 0) + self.assertEqual(values[self.total_size_in_bytes_attribute()], 0) @unittest.skipIf(test.settings.RUN_IN_TOPOLOGY, "Skip for Topology Testing") def test_executing_logical_quotas_rules_do_not_fail_when_group_permissions_are_present__issue_46(self): @@ -940,8 +940,8 @@ def make_directory(self, dir_name, files, file_size): def assert_quotas(self, coll, expected_number_of_objects, expected_size_in_bytes): values = self.get_logical_quotas_attribute_values(coll) - self.assertEquals(values[self.total_number_of_data_objects_attribute()], expected_number_of_objects) - self.assertEquals(values[self.total_size_in_bytes_attribute()], expected_size_in_bytes) + self.assertEqual(values[self.total_number_of_data_objects_attribute()], expected_number_of_objects) + self.assertEqual(values[self.total_size_in_bytes_attribute()], expected_size_in_bytes) def enable_rule_engine_plugin(self, config, namespace=None): config.server_config['log_level']['rule_engine'] = 'trace'