Skip to content

Commit

Permalink
Update exception info
Browse files Browse the repository at this point in the history
  • Loading branch information
BigTailWolf committed Jul 28, 2022
1 parent be5a707 commit 87f65a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion google/auth/pluggable.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def _parse_subject_token(self, response):
and self._credential_source_executable_output_file
):
raise ValueError(
"The output file response must contain the expiration_time field when success=true."
"The executable response must contain an expiration_time for successful responses when an output_file has been specified in the configuration."
)
if "expiration_time" in response and response["expiration_time"] < time.time():
raise exceptions.RefreshError(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pluggable.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ def test_retrieve_subject_token_without_expiration_time_should_fail_when_output_
_ = credentials.retrieve_subject_token(None)

assert excinfo.match(
r"The output file response must contain the expiration_time field when success=true."
r"The executable response must contain an expiration_time for successful responses when an output_file has been specified in the configuration."
)

@mock.patch.dict(os.environ, {"GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES": "1"})
Expand All @@ -680,7 +680,7 @@ def test_retrieve_subject_token_without_expiration_time_should_fail_when_retriev
_ = credentials.retrieve_subject_token(None)

assert excinfo.match(
r"The output file response must contain the expiration_time field when success=true."
r"The executable response must contain an expiration_time for successful responses when an output_file has been specified in the configuration."
)
os.remove(ACTUAL_CREDENTIAL_SOURCE_EXECUTABLE_OUTPUT_FILE)

Expand Down

0 comments on commit 87f65a8

Please sign in to comment.