Skip to content

Commit

Permalink
comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
ozayr-zaviar committed Apr 30, 2021
1 parent c2d6752 commit 790ee40
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions tests/test_decision_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,7 @@ def test_get_variation_for_feature__returns_variation_if_user_not_in_experiment_
side_effect=[[False, []], [True, []]],
) as mock_audience_check, self.mock_decision_logger as mock_decision_service_logging, mock.patch(
"optimizely.bucketer.Bucketer.bucket", return_value=[expected_variation, []]):

decision, _ = self.decision_service.get_variation_for_feature(
self.project_config, feature, "test_user"
)
Expand Down Expand Up @@ -1342,24 +1343,6 @@ def test_get_variation_for_feature__returns_variation_for_feature_in_group(self)
False
)

def test_get_variation_for_feature__returns_none_for_user_not_in_group(self):
""" Test that get_variation_for_feature returns None for
user not in group and the feature is not part of a rollout. """

feature = self.project_config.get_feature_from_key("test_feature_in_group")

with mock.patch(
"optimizely.decision_service.DecisionService.get_variation",
return_value=[None, []],
):
variation_received, _ = self.decision_service.get_variation_for_feature(
self.project_config, feature, "test_user"
)
self.assertEqual(
decision_service.Decision(None, None, enums.DecisionSources.ROLLOUT),
variation_received,
)

def test_get_variation_for_feature__returns_none_for_user_not_in_experiment(self):
""" Test that get_variation_for_feature returns None for user not in the associated experiment. """

Expand All @@ -1385,20 +1368,6 @@ def test_get_variation_for_feature__returns_none_for_user_not_in_experiment(self
False
)

def test_get_variation_for_feature__returns_none_for_invalid_group_id(self):
""" Test that get_variation_for_feature returns None for unknown group ID. """

feature = self.project_config.get_feature_from_key("test_feature_in_group")
feature.groupId = "aabbccdd"

variation_received, _ = self.decision_service.get_variation_for_feature(
self.project_config, feature, "test_user"
)
self.assertEqual(
decision_service.Decision(None, None, enums.DecisionSources.ROLLOUT),
variation_received,
)

def test_get_variation_for_feature__returns_none_for_user_in_group_experiment_not_associated_with_feature(
self,
):
Expand Down

0 comments on commit 790ee40

Please sign in to comment.