From efed79a18c2c66bccb42aa214610fa5e7f9898dc Mon Sep 17 00:00:00 2001 From: Siddharth Dinesh Date: Thu, 8 Oct 2020 16:04:38 -0700 Subject: [PATCH] fix: Fixes VPCSC Tests that did not conform to V2.0.0 client API (#61) The fix in the previous commit worked for the test_async_batch_annotate_images_write_blocked test. This commit updates other VPCSC tests to also work with the new client. --- tests/system.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/system.py b/tests/system.py index 646a1420..897b8bf0 100644 --- a/tests/system.py +++ b/tests/system.py @@ -815,7 +815,7 @@ def test_async_batch_annotate_files_read_blocked(self): "output_config": {"gcs_destination": {"uri": output_gcs_uri_prefix}}, } with pytest.raises(exceptions.Forbidden) as exc: - self.client.async_batch_annotate_files([request]) + self.client.async_batch_annotate_files(requests=[request]) assert self.gcs_read_error_message in exc.value.message @@ -844,7 +844,7 @@ def test_async_batch_annotate_files_write_blocked(self): "features": [{"type_": vision.Feature.Type.DOCUMENT_TEXT_DETECTION}], "output_config": {"gcs_destination": {"uri": output_gcs_uri_prefix}}, } - response = self.client.async_batch_annotate_files([request]) + response = self.client.async_batch_annotate_files(requests=[request]) # Wait for the operation to complete. lro_waiting_seconds = 90 @@ -868,7 +868,9 @@ def test_async_batch_annotate_images_read_blocked(self): bucket=self.test_bucket.name, method_name=method_name ) output_config = {"gcs_destination": {"uri": output_gcs_uri_prefix}} - response = self.client.async_batch_annotate_images([request], output_config) + response = self.client.async_batch_annotate_images( + requests=[request], output_config=output_config + ) # Wait for the operation to complete. lro_waiting_seconds = 90 start_time = time.time() @@ -905,7 +907,9 @@ def test_async_batch_annotate_images_write_blocked(self): bucket=vpcsc_config.bucket_outside, method_name=method_name ) output_config = {"gcs_destination": {"uri": output_gcs_uri_prefix}} - response = self.client.async_batch_annotate_images([request], output_config) + response = self.client.async_batch_annotate_images( + requests=[request], output_config=output_config + ) # Wait for the operation to complete. lro_waiting_seconds = 90 start_time = time.time()