Skip to content

Commit

Permalink
🖊️ PEP8 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oakbani committed Jun 1, 2018
1 parent ca14331 commit c458c08
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion optimizely/event_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions optimizely/project_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))

Expand All @@ -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'))

Expand Down
1 change: 0 additions & 1 deletion tests/test_event_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. """
Expand Down
6 changes: 4 additions & 2 deletions tests/test_optimizely.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit c458c08

Please sign in to comment.