Skip to content

Commit b55582c

Browse files
Removing unused get_events_map and get_Attributes_map along with testing for those two functions. (#340)
1 parent 7cc2bde commit b55582c

File tree

2 files changed

+0
-76
lines changed

2 files changed

+0
-76
lines changed

optimizely/optimizely_config.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -295,37 +295,3 @@ def _get_features_map(self, experiments_id_map):
295295
features_map[feature['key']] = optly_feature
296296

297297
return features_map
298-
299-
def get_attributes_map(self):
300-
""" Gets attributes map for the project config.
301-
302-
Returns:
303-
dict -- Attribute key, OptimizelyAttribute map
304-
"""
305-
306-
attributes_map = {}
307-
308-
for attribute in self.attributes:
309-
optly_attribute = OptimizelyAttribute(
310-
attribute['id'], attribute['key']
311-
)
312-
attributes_map[attribute['key']] = optly_attribute
313-
314-
return attributes_map
315-
316-
def get_events_map(self):
317-
""" Gets events map for the project config.
318-
319-
Returns:
320-
dict -- Event key, OptimizelyEvent map
321-
"""
322-
323-
events_map = {}
324-
325-
for event in self.events:
326-
optly_event = OptimizelyEvent(
327-
event['id'], event['key'], event.get('experimentIds', [])
328-
)
329-
events_map[event['key']] = optly_event
330-
331-
return events_map

tests/test_optimizely_config.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -863,45 +863,3 @@ def test__get_events(self):
863863

864864
self.assertEqual(expected_value, config.get_events())
865865
self.assertEqual(len(config.get_events()), 2)
866-
867-
def test__get_attributes_map(self):
868-
""" Test to check get_attributes_map returns the correct value """
869-
870-
actual_attributes_map = self.opt_config_service.get_attributes_map()
871-
expected_attributes = self.expected_config['attributes']
872-
873-
expected_attributes_map = {}
874-
875-
for expected_attribute in expected_attributes:
876-
optly_attribute = optimizely_config.OptimizelyAttribute(
877-
expected_attribute['id'], expected_attribute['key']
878-
)
879-
expected_attributes_map[expected_attribute['key']] = optly_attribute
880-
881-
for attribute in actual_attributes_map.values():
882-
self.assertIsInstance(attribute, optimizely_config.OptimizelyAttribute)
883-
884-
self.assertEqual(len(expected_attributes), len(actual_attributes_map))
885-
self.assertEqual(self.to_dict(actual_attributes_map), self.to_dict(expected_attributes_map))
886-
887-
def test__get_events_map(self):
888-
""" Test to check that get_events_map returns the correct value """
889-
890-
actual_events_map = self.opt_config_service.get_events_map()
891-
expected_events = self.expected_config['events']
892-
893-
expected_events_map = {}
894-
895-
for expected_event in expected_events:
896-
optly_event = optimizely_config.OptimizelyEvent(
897-
expected_event['id'],
898-
expected_event['key'],
899-
expected_event['experimentIds']
900-
)
901-
expected_events_map[expected_event['key']] = optly_event
902-
903-
for event in actual_events_map.values():
904-
self.assertIsInstance(event, optimizely_config.OptimizelyEvent)
905-
906-
self.assertEqual(len(expected_events), len(actual_events_map))
907-
self.assertEqual(self.to_dict(actual_events_map), self.to_dict(expected_events_map))

0 commit comments

Comments
 (0)