diff options
author | Jon Wayne Parrott <jon.wayne.parrott@gmail.com> | 2016-04-08 12:33:13 -0700 |
---|---|---|
committer | Jon Wayne Parrott <jon.wayne.parrott@gmail.com> | 2016-04-08 14:19:10 -0700 |
commit | 2f724203e41c771b4cc4e91b283833baf66f9c5f (patch) | |
tree | e86ecf8b08b118b23967058e46473118cc09a0ab /oauth2client | |
parent | ef33f70abb43da50793f169ad7efdd4c72df4966 (diff) | |
download | oauth2client-2f724203e41c771b4cc4e91b283833baf66f9c5f.tar.gz |
100% coverage for oauth2client.contrib.multistore_file
Diffstat (limited to 'oauth2client')
-rw-r--r-- | oauth2client/contrib/multistore_file.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/oauth2client/contrib/multistore_file.py b/oauth2client/contrib/multistore_file.py index 08c3583..483b0fb 100644 --- a/oauth2client/contrib/multistore_file.py +++ b/oauth2client/contrib/multistore_file.py @@ -108,7 +108,7 @@ def get_credential_storage(filename, client_id, user_agent, scope, key = {'clientId': client_id, 'userAgent': user_agent, 'scope': util.scopes_to_string(scope)} return get_credential_storage_custom_key( - filename, key, warn_on_readonly=warn_on_readonly) + filename, key, warn_on_readonly=warn_on_readonly) @util.positional(2) @@ -131,7 +131,7 @@ def get_credential_storage_custom_string_key(filename, key_string, # Create a key dictionary that can be used key_dict = {'key': key_string} return get_credential_storage_custom_key( - filename, key_dict, warn_on_readonly=warn_on_readonly) + filename, key_dict, warn_on_readonly=warn_on_readonly) @util.positional(2) @@ -319,6 +319,7 @@ class _MultiStore(object): 'Opening in read-only mode. Any refreshed ' 'credentials will only be ' 'valid for this run.', self._file.filename()) + if os.path.getsize(self._file.filename()) == 0: logger.debug('Initializing empty multistore file') # The multistore is empty so write out an empty file. |