Add error message to handle case of empty string or missing file for GOOGLE_APPLICATION_CREDENTIALS (#188) Fixes #161
diff --git a/tests/test__default.py b/tests/test__default.py index 8054ac5..2df8a44 100644 --- a/tests/test__default.py +++ b/tests/test__default.py
@@ -43,6 +43,13 @@ mock.sentinel.credentials, mock.sentinel.project_id), autospec=True) +def test__load_credentials_from_missing_file(): + with pytest.raises(exceptions.DefaultCredentialsError) as excinfo: + _default._load_credentials_from_file('') + + assert excinfo.match(r'not found') + + def test__load_credentials_from_file_invalid_json(tmpdir): jsonfile = tmpdir.join('invalid.json') jsonfile.write('{')