Skip to content

Commit

Permalink
update rrio test
Browse files Browse the repository at this point in the history
  • Loading branch information
riteshghorse committed Feb 14, 2024
1 parent 7a721dd commit 068cb6f
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions sdks/python/apache_beam/io/requestresponse_it_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,6 @@ def setUpClass(cls) -> None:

cls.client = EchoHTTPCaller(http_endpoint_address)

def setUp(self) -> None:
client, options = EchoHTTPCallerTestIT._get_client_and_options()

req = Request(id=options.should_exceed_quota_id, payload=_PAYLOAD)
try:
# The following is needed to exceed the API
client(req)
client(req)
client(req)
except UserCodeExecutionException as e:
if not isinstance(e, UserCodeQuotaException):
raise e

@classmethod
def _get_client_and_options(cls) -> Tuple[EchoHTTPCaller, EchoITOptions]:
assert cls.options is not None
Expand All @@ -173,7 +160,14 @@ def test_given_exceeded_quota_should_raise(self):
client, options = EchoHTTPCallerTestIT._get_client_and_options()

req = Request(id=options.should_exceed_quota_id, payload=_PAYLOAD)

try:
# The following is needed to exceed the API
client(req)
client(req)
client(req)
except UserCodeExecutionException as e:
if not isinstance(e, UserCodeQuotaException):
raise e
self.assertRaises(UserCodeQuotaException, lambda: client(req))

def test_not_found_should_raise(self):
Expand Down

0 comments on commit 068cb6f

Please sign in to comment.