-
Notifications
You must be signed in to change notification settings - Fork 36
Duplicate experiment Key issue with multi feature flag #347
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
Changes from all commits
12de61b
bf7e099
ff9625b
b6324c9
ba99b6f
4e25c21
f0c1733
617cc4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
[flake8] | ||
# E722 - do not use bare 'except' | ||
ignore = E722 | ||
# W504 - Either W503 (Line break after Operand) or W503 ( | ||
# Line break before operand needs to be ignored for line lengths | ||
# greater than max-line-length. Best practice shows W504 | ||
ignore = E722, W504 | ||
exclude = optimizely/lib/pymmh3.py,*virtualenv* | ||
max-line-length = 120 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ def test_init(self): | |
self.config_dict['groups'][0]['trafficAllocation'], | ||
) | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only curious because it was by itself. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need a new line to satisfy Flake8 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. formatter... |
||
expected_experiment_key_map = { | ||
'test_experiment': entities.Experiment( | ||
'111127', | ||
|
@@ -1213,3 +1214,27 @@ def test_is_feature_experiment(self): | |
|
||
self.assertStrictFalse(project_config.is_feature_experiment(experiment.id)) | ||
self.assertStrictTrue(project_config.is_feature_experiment(feature_experiment.id)) | ||
|
||
def test_get_variation_from_id_by_experiment_id(self): | ||
|
||
opt_obj = optimizely.Optimizely(json.dumps(self.config_dict)) | ||
project_config = opt_obj.config_manager.get_config() | ||
|
||
experiment_id = '111127' | ||
variation_id = '111128' | ||
|
||
variation = project_config.get_variation_from_id_by_experiment_id(experiment_id, variation_id) | ||
|
||
self.assertIsInstance(variation, entities.Variation) | ||
|
||
def test_get_variation_from_key_by_experiment_id(self): | ||
|
||
opt_obj = optimizely.Optimizely(json.dumps(self.config_dict)) | ||
project_config = opt_obj.config_manager.get_config() | ||
|
||
experiment_id = '111127' | ||
variation_key = 'control' | ||
|
||
variation = project_config.get_variation_from_key_by_experiment_id(experiment_id, variation_key) | ||
|
||
self.assertIsInstance(variation, entities.Variation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please explain in the comments, why W504 added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment added explaining the reason for W504.