diff --git a/optimizely/event_builder.py b/optimizely/event_builder.py index 7d7b8a45..1b944fd5 100644 --- a/optimizely/event_builder.py +++ b/optimizely/event_builder.py @@ -90,7 +90,7 @@ def _get_bot_filtering(self): """ Get bot filtering bool Returns: - bool 'botFiltering' value in the datafile. + 'botFiltering' value in the datafile. """ return self.config.get_bot_filtering_value() diff --git a/optimizely/project_config.py b/optimizely/project_config.py index bf1c3c51..77da812c 100644 --- a/optimizely/project_config.py +++ b/optimizely/project_config.py @@ -382,8 +382,8 @@ def get_attribute_id(self, attribute_key): if attribute: if has_reserved_prefix: self.logger.log(enums.LogLevels.WARNING, - 'Attribute %s unexpectedly has reserved prefix %s; using attribute ID instead of reserved attribute name.' - % (attribute_key, RESERVED_ATTRIBUTE_PREFIX)) + ('Attribute %s unexpectedly has reserved prefix %s; using attribute ID ' + 'instead of reserved attribute name.' % (attribute_key, RESERVED_ATTRIBUTE_PREFIX))) return attribute.id diff --git a/tests/test_config.py b/tests/test_config.py index deb806f1..cc5b9d00 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -815,7 +815,7 @@ def test_get_attribute_id__invalid_key(self): self.assertIsNone(self.project_config.get_attribute_id('invalid_key')) def test_get_attribute_id__reserved_key(self): - """ Test that Attribute Key is returned as ID when provided attribute key is invalid. """ + """ Test that Attribute Key is returned as ID when provided attribute key is reserved key. """ self.assertEqual('$opt_user_agent', self.project_config.get_attribute_id('$opt_user_agent')) @@ -826,7 +826,7 @@ def test_get_attribute_id__unknown_key_with_opt_prefix(self): self.project_config.get_attribute_id('$opt_interesting')) def test_get_attribute_id__key_is_bot_filtering_enum(self): - """ Test that None is returned when provided attribute key is + """ Test that None is returned when provided attribute key is equal to '$opt_bot_filtering'. """ self.assertIsNone(self.project_config.get_attribute_id('$opt_bot_filtering')) diff --git a/tests/test_event_builder.py b/tests/test_event_builder.py index 39af89f2..bb848e85 100644 --- a/tests/test_event_builder.py +++ b/tests/test_event_builder.py @@ -294,7 +294,6 @@ def test_create_impression_event__with_user_agent_when_bot_filtering_is_disabled event_builder.EventBuilder.HTTP_VERB, event_builder.EventBuilder.HTTP_HEADERS) - def test_create_conversion_event(self): """ Test that create_conversion_event creates Event object with right params when no attributes are provided. """ diff --git a/tests/test_optimizely.py b/tests/test_optimizely.py index 3dd05e0c..60b201f6 100644 --- a/tests/test_optimizely.py +++ b/tests/test_optimizely.py @@ -609,7 +609,7 @@ def test_activate__with_attributes__audience_match__bucketing_id_provided(self): 'value': 'user_bucket_value', 'entity_id': '$opt_bucketing_id', 'key': '$opt_bucketing_id' - },{ + }, { 'type': 'custom', 'value': 'test_value', 'entity_id': '111094', @@ -782,7 +782,7 @@ def test_track__with_attributes__bucketing_id_provided(self): 'value': 'user_bucket_value', 'entity_id': '$opt_bucketing_id', 'key': '$opt_bucketing_id' - },{ + }, { 'type': 'custom', 'value': 'test_value', 'entity_id': '111094', @@ -1754,6 +1754,7 @@ def test_get_feature_variable__returns_none_if_unable_to_cast(self): class OptimizelyWithExceptionTest(base.BaseTest): + def setUp(self): base.BaseTest.setUp(self) self.optimizely = optimizely.Optimizely(json.dumps(self.config_dict), @@ -1785,6 +1786,7 @@ def test_get_variation__with_attributes__invalid_attributes(self): class OptimizelyWithLoggingTest(base.BaseTest): + def setUp(self): base.BaseTest.setUp(self) self.optimizely = optimizely.Optimizely(json.dumps(self.config_dict), logger=logger.SimpleLogger())