From c22432befda0e5ffdae265b8385ec924357c0558 Mon Sep 17 00:00:00 2001 From: Jacob Brown Date: Tue, 29 Jun 2021 10:17:34 -0400 Subject: [PATCH] Removing unused get_events_map and get_Attributes_map along with testing for those two functions. --- optimizely/optimizely_config.py | 34 -------------------------- tests/test_optimizely_config.py | 42 --------------------------------- 2 files changed, 76 deletions(-) diff --git a/optimizely/optimizely_config.py b/optimizely/optimizely_config.py index 47dae824..f204263a 100644 --- a/optimizely/optimizely_config.py +++ b/optimizely/optimizely_config.py @@ -295,37 +295,3 @@ def _get_features_map(self, experiments_id_map): features_map[feature['key']] = optly_feature return features_map - - def get_attributes_map(self): - """ Gets attributes map for the project config. - - Returns: - dict -- Attribute key, OptimizelyAttribute map - """ - - attributes_map = {} - - for attribute in self.attributes: - optly_attribute = OptimizelyAttribute( - attribute['id'], attribute['key'] - ) - attributes_map[attribute['key']] = optly_attribute - - return attributes_map - - def get_events_map(self): - """ Gets events map for the project config. - - Returns: - dict -- Event key, OptimizelyEvent map - """ - - events_map = {} - - for event in self.events: - optly_event = OptimizelyEvent( - event['id'], event['key'], event.get('experimentIds', []) - ) - events_map[event['key']] = optly_event - - return events_map diff --git a/tests/test_optimizely_config.py b/tests/test_optimizely_config.py index 8ff8986b..29bd2443 100644 --- a/tests/test_optimizely_config.py +++ b/tests/test_optimizely_config.py @@ -863,45 +863,3 @@ def test__get_events(self): self.assertEqual(expected_value, config.get_events()) self.assertEqual(len(config.get_events()), 2) - - def test__get_attributes_map(self): - """ Test to check get_attributes_map returns the correct value """ - - actual_attributes_map = self.opt_config_service.get_attributes_map() - expected_attributes = self.expected_config['attributes'] - - expected_attributes_map = {} - - for expected_attribute in expected_attributes: - optly_attribute = optimizely_config.OptimizelyAttribute( - expected_attribute['id'], expected_attribute['key'] - ) - expected_attributes_map[expected_attribute['key']] = optly_attribute - - for attribute in actual_attributes_map.values(): - self.assertIsInstance(attribute, optimizely_config.OptimizelyAttribute) - - self.assertEqual(len(expected_attributes), len(actual_attributes_map)) - self.assertEqual(self.to_dict(actual_attributes_map), self.to_dict(expected_attributes_map)) - - def test__get_events_map(self): - """ Test to check that get_events_map returns the correct value """ - - actual_events_map = self.opt_config_service.get_events_map() - expected_events = self.expected_config['events'] - - expected_events_map = {} - - for expected_event in expected_events: - optly_event = optimizely_config.OptimizelyEvent( - expected_event['id'], - expected_event['key'], - expected_event['experimentIds'] - ) - expected_events_map[expected_event['key']] = optly_event - - for event in actual_events_map.values(): - self.assertIsInstance(event, optimizely_config.OptimizelyEvent) - - self.assertEqual(len(expected_events), len(actual_events_map)) - self.assertEqual(self.to_dict(actual_events_map), self.to_dict(expected_events_map))