From b31ced262d928d9a4917b5c48520463146f10183 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Fri, 11 Sep 2020 17:09:17 -0600 Subject: [PATCH] test: fix vpc tests (#53) --- .../v2/test_system_dlp_service_v2_vpcsc.py | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/packages/google-cloud-dlp/tests/system/gapic/v2/test_system_dlp_service_v2_vpcsc.py b/packages/google-cloud-dlp/tests/system/gapic/v2/test_system_dlp_service_v2_vpcsc.py index 0403156a7c54..dd1ffd690e22 100644 --- a/packages/google-cloud-dlp/tests/system/gapic/v2/test_system_dlp_service_v2_vpcsc.py +++ b/packages/google-cloud-dlp/tests/system/gapic/v2/test_system_dlp_service_v2_vpcsc.py @@ -54,16 +54,14 @@ def bytes_content_item(): @vpcsc_config.skip_unless_inside_vpcsc def test_inspect_content_inside(client, name_inside, content_item): client.inspect_content( - request={"parent": name_inside, "inspect_config": content_item} + request={"parent": name_inside, "item": content_item} ) # no perms issue @vpcsc_config.skip_unless_inside_vpcsc def test_inspect_content_outside(client, name_outside, content_item): with pytest.raises(exceptions.PermissionDenied) as exc: - client.inspect_content( - request={"parent": name_outside, "inspect_config": content_item} - ) + client.inspect_content(request={"parent": name_outside, "item": content_item}) assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message @@ -72,7 +70,7 @@ def test_inspect_content_outside(client, name_outside, content_item): def test_redact_image_inside(client, name_inside, bytes_content_item): with pytest.raises(exceptions.InvalidArgument): # no perms issue client.redact_image( - request={"parent": name_inside, "location_id": bytes_content_item} + request={"parent": name_inside, "byte_item": bytes_content_item} ) @@ -80,7 +78,7 @@ def test_redact_image_inside(client, name_inside, bytes_content_item): def test_redact_image_outside(client, name_outside, bytes_content_item): with pytest.raises(exceptions.PermissionDenied) as exc: client.redact_image( - request={"parent": name_outside, "location_id": bytes_content_item} + request={"parent": name_outside, "byte_item": bytes_content_item} ) assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message @@ -89,16 +87,14 @@ def test_redact_image_outside(client, name_outside, bytes_content_item): @vpcsc_config.skip_unless_inside_vpcsc def test_deidentify_content_inside(client, name_inside, content_item): with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.deidentify_content( - request={"parent": name_inside, "deidentify_config": content_item} - ) + client.deidentify_content(request={"parent": name_inside, "item": content_item}) @vpcsc_config.skip_unless_inside_vpcsc def test_deidentify_content_outside(client, name_outside, content_item): with pytest.raises(exceptions.PermissionDenied) as exc: client.deidentify_content( - request={"parent": name_outside, "deidentify_config": content_item} + request={"parent": name_outside, "item": content_item} ) assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message @@ -107,16 +103,14 @@ def test_deidentify_content_outside(client, name_outside, content_item): @vpcsc_config.skip_unless_inside_vpcsc def test_reidentify_content_inside(client, name_inside, content_item): with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.reidentify_content( - request={"parent": name_inside, "reidentify_config": content_item} - ) + client.reidentify_content(request={"parent": name_inside, "item": content_item}) @vpcsc_config.skip_unless_inside_vpcsc def test_reidentify_content_outside(client, name_outside, content_item): with pytest.raises(exceptions.PermissionDenied) as exc: client.reidentify_content( - request={"parent": name_outside, "reidentify_config": content_item} + request={"parent": name_outside, "item": content_item} ) assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message @@ -488,13 +482,17 @@ def test_delete_job_trigger_outside(client, job_trigger_path_outside): @pytest.fixture(scope="module") def stored_info_type_path_inside(client): stored_info_type_id = 1234567 - return f"organizations/{vpcsc_config.project_inside}/storedInfoTypes/{stored_info_type_id}" + return ( + f"projects/{vpcsc_config.project_inside}/storedInfoTypes/{stored_info_type_id}" + ) @pytest.fixture(scope="module") def stored_info_type_path_outside(client): stored_info_type_id = 1234567 - return f"organizations/{vpcsc_config.project_outside}/storedInfoTypes/{stored_info_type_id}" + return ( + f"projects/{vpcsc_config.project_outside}/storedInfoTypes/{stored_info_type_id}" + ) @pytest.fixture(scope="module")