diff --git a/optimizely/config_manager.py b/optimizely/config_manager.py index 13ee5b42..8761fb38 100644 --- a/optimizely/config_manager.py +++ b/optimizely/config_manager.py @@ -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): @@ -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() @@ -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 @@ -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 @@ -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): diff --git a/tests/test_optimizely.py b/tests/test_optimizely.py index 256ac100..46e03265 100644 --- a/tests/test_optimizely.py +++ b/tests/test_optimizely.py @@ -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'