Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
fix: Raise not implemented error when REST transport is not supported (
Browse files Browse the repository at this point in the history
…#170)

* fix: Raise not implemented error when REST transport is not supported

PiperOrigin-RevId: 507594646

Source-Link: googleapis/googleapis@ee8c334

Source-Link: googleapis/googleapis-gen@ac8cbed
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWM4Y2JlZGY0M2IzZTI2ZTk4YjcxM2U0ZDYxOWI1N2VhMWZjNzM3NiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Feb 7, 2023
1 parent ba8af34 commit 44651ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ def __call__(
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> jobs.CheckActiveJobsResponse:
raise RuntimeError(
"Cannot define a method without a valid 'google.api.http' annotation."
raise NotImplementedError(
"Method CheckActiveJobs is not available over REST transport"
)

class _CreateJob(JobsV1Beta3RestStub):
Expand Down
7 changes: 3 additions & 4 deletions tests/unit/gapic/dataflow_v1beta3/test_jobs_v1_beta3.py
Original file line number Diff line number Diff line change
Expand Up @@ -4118,11 +4118,10 @@ def test_check_active_jobs_rest_error():
)
# Since a `google.api.http` annotation is required for using a rest transport
# method, this should error.
with pytest.raises(RuntimeError) as runtime_error:
with pytest.raises(NotImplementedError) as not_implemented_error:
client.check_active_jobs({})
assert (
"Cannot define a method without a valid 'google.api.http' annotation."
in str(runtime_error.value)
assert "Method CheckActiveJobs is not available over REST transport" in str(
not_implemented_error.value
)


Expand Down

0 comments on commit 44651ca

Please sign in to comment.