Skip to content

implements missing validations #105

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

Closed
wants to merge 4 commits into from

Conversation

rashidsp
Copy link
Contributor

No description provided.

@optibot
Copy link

optibot commented Mar 15, 2018

Can one of the admins verify this patch?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 97.533% when pulling 51d1906 on rashid/optimizely-missing-validations into cb28ea4 on master.

@coveralls
Copy link

coveralls commented Mar 15, 2018

Coverage Status

Coverage increased (+0.01%) to 97.533% when pulling 672b834 on rashid/optimizely-missing-validations into cb28ea4 on master.


mock_logger.assert_called_once_with(enums.LogLevels.ERROR, enums.Errors.NONE_USER_ID_PARAMETER)
mock_logger.assert_called_with(enums.LogLevels.ERROR, enums.Errors.INVALID_USER_ID_ERROR)
Copy link
Contributor

Choose a reason for hiding this comment

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

This check only asserts the last call and not both calls. What you can do is assertFalseand check log message and then again do the same thing.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you have taken a similar approach below.

self.optimizely.track('test_event', None, event_tags=4200)

mock_logging.assert_called_with(enums.LogLevels.ERROR, enums.Errors.INVALID_USER_ID_ERROR)
self.assertEqual(2, mock_logging.call_count)
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar comment as above.

self.optimizely.get_variation('test_experiment', None, attributes={'test_attribute': 'test_value'})

mock_logging.assert_called_with(enums.LogLevels.ERROR, enums.Errors.INVALID_USER_ID_ERROR)
self.assertEqual(2, mock_logging.call_count)
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar comment as above.

@rashidsp
Copy link
Contributor Author

Closing this PR as most of the APIs params validation have been addressed in #119
However we will create separate PR for params validation of _get_feature_variable_for_type method.

@rashidsp rashidsp closed this Aug 28, 2018
@aliabbasrizvi aliabbasrizvi deleted the rashid/optimizely-missing-validations branch January 9, 2019 20:48
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.

4 participants