Skip to content

Commit 8204f92

Browse files
Merge pull request #60 from optimizely/arizvi/cleanup_tests
Fixing test relying on ordering
2 parents 90d5500 + f260e56 commit 8204f92

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

optimizely/user_profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def save_variation_for_experiment(self, experiment_id, variation_id):
4848
4949
Args:
5050
experiment_id: ID for experiment for which the decision is to be stored.
51-
variation_id: ID for variation that the user saw.
51+
variation_id: ID for variation that the user saw.
5252
"""
5353

5454
self.experiment_bucket_map.update({

tests/test_optimizely.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,10 @@ def side_effect(*args, **kwargs):
596596
with mock.patch(
597597
'optimizely.optimizely.Optimizely.is_feature_enabled',
598598
side_effect=side_effect) as mock_is_feature_enabled:
599-
expected_enabled_features = ['test_feature_1', 'test_feature_2']
600-
self.assertEqual(expected_enabled_features, optimizely_instance.get_enabled_features('user_1'))
599+
received_features = optimizely_instance.get_enabled_features('user_1')
601600

601+
expected_enabled_features = ['test_feature_1', 'test_feature_2']
602+
self.assertEqual(sorted(expected_enabled_features), sorted(received_features))
602603
mock_is_feature_enabled.assert_any_call('test_feature_1', 'user_1', None)
603604
mock_is_feature_enabled.assert_any_call('test_feature_2', 'user_1', None)
604605
mock_is_feature_enabled.assert_any_call('test_feature_in_group', 'user_1', None)

0 commit comments

Comments
 (0)