Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(set_forced_variation): Treats empty variation key as invalid and does not reset forced variation. #149

Merged
merged 1 commit into from
Nov 13, 2018

Conversation

rashidsp
Copy link
Contributor

Summary

  • Forced variation key passed as an empty String will be invalid argument.
  • Updated inputs validation for set_forced_variation.
  • Updated unit tests for empty string variation key.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 99.668% when pulling ced6bd4 on rashid/set-invalid-forced-variation-empty into 1c34da4 on master.

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

self.assertTrue(self.project_config.set_forced_variation('test_experiment', 'test_user', None))

with mock.patch.object(self.project_config, 'logger') as mock_config_logging:
self.assertIs(self.project_config.set_forced_variation('test_experiment', 'test_user', ''), False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. Use self.assertFalse instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertFalse asserts Falsy value which includes None. assert_is ensures that we are returning strictly False from the method.

@mikeproeng37 mikeproeng37 merged commit 46d31a6 into master Nov 13, 2018
@oakbani oakbani deleted the rashid/set-invalid-forced-variation-empty branch November 14, 2018 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants