Skip to content

Commit

Permalink
style: fix small linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pthompson127 committed Jul 6, 2020
1 parent e0e97ea commit 8055208
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
22 changes: 11 additions & 11 deletions optimizely/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ def __init__(
def _set_config(self, datafile):
""" Looks up and sets datafile and config based on response body.
Args:
datafile: JSON string representing the Optimizely project.
"""
Args:
datafile: JSON string representing the Optimizely project.
"""

if self.validate_schema:
if not validator.is_datafile_valid(datafile):
Expand Down Expand Up @@ -239,9 +239,9 @@ def get_datafile_url(sdk_key, url, url_template):
def _set_config(self, datafile):
""" Looks up and sets datafile and config based on response body.
Args:
datafile: JSON string representing the Optimizely project.
"""
Args:
datafile: JSON string representing the Optimizely project.
"""
if datafile or self._config_ready_event.is_set():
super(PollingConfigManager, self)._set_config(datafile=datafile)
self._config_ready_event.set()
Expand All @@ -261,7 +261,7 @@ def set_update_interval(self, update_interval):
""" Helper method to set frequency at which datafile has to be polled and ProjectConfig updated.
Args:
update_interval: Time in seconds after which to update datafile.
update_interval: Time in seconds after which to update datafile.
"""
if update_interval is None:
update_interval = enums.ConfigManager.DEFAULT_UPDATE_INTERVAL
Expand All @@ -287,7 +287,7 @@ def set_blocking_timeout(self, blocking_timeout):
""" Helper method to set time in seconds to block the config call until config has been initialized.
Args:
blocking_timeout: Time in seconds to block the config call.
blocking_timeout: Time in seconds to block the config call.
"""
if blocking_timeout is None:
blocking_timeout = enums.ConfigManager.DEFAULT_BLOCKING_TIMEOUT
Expand All @@ -312,9 +312,9 @@ def set_blocking_timeout(self, blocking_timeout):
def set_last_modified(self, response_headers):
""" Looks up and sets last modified time based on Last-Modified header in the response.
Args:
response_headers: requests.Response.headers
"""
Args:
response_headers: requests.Response.headers
"""
self.last_modified = response_headers.get(enums.HTTPHeaders.LAST_MODIFIED)

def _handle_response(self, response):
Expand Down
5 changes: 4 additions & 1 deletion tests/test_optimizely.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ def test_init__sdk_key_and_datafile(self):
self.assertIs(type(opt_obj.config_manager), config_manager.PollingConfigManager)

def test_init__sdk_key_and_datafile_access_token(self):
""" Test that if both sdk_key and datafile_access_token is provided then AuthDatafilePollingConfigManager is used. """
"""
Test that if both sdk_key and datafile_access_token is provided then AuthDatafilePollingConfigManager
is used.
"""

with mock.patch('optimizely.config_manager.AuthDatafilePollingConfigManager._set_config'), mock.patch(
'threading.Thread.start'
Expand Down

0 comments on commit 8055208

Please sign in to comment.