Skip to content

Commit

Permalink
fix: fix vpcsc tests (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 committed Sep 9, 2020
1 parent 78db82c commit 59d9a2c
Showing 1 changed file with 14 additions and 24 deletions.
Expand Up @@ -43,12 +43,12 @@ def name_outside(client):

@pytest.fixture(scope="module")
def content_item():
return dlp_pb2.ContentItem(value="testing")
return dlp_v2.ContentItem(value="testing")


@pytest.fixture(scope="module")
def bytes_content_item():
return dlp_pb2.ByteContentItem(data=b"DEADBEEF")
return dlp_v2.ByteContentItem(data=b"DEADBEEF")


@vpcsc_config.skip_unless_inside_vpcsc
Expand Down Expand Up @@ -125,22 +125,20 @@ def test_reidentify_content_outside(client, name_outside, content_item):
@pytest.fixture(scope="module")
def inspect_template_path_inside(client):
inspect_template_id = 1234567
return client.inspect_template_path(
vpcsc_config.project_inside, inspect_template_id
return (
f"projects/{vpcsc_config.project_inside}/inspectTemplates/{inspect_template_id}"
)


@pytest.fixture(scope="module")
def inspect_template_path_outside(client):
inspect_template_id = 1234567
return client.inspect_template_path(
vpcsc_config.project_outside, inspect_template_id
)
return f"projects/{vpcsc_config.project_outside}/inspectTemplates/{inspect_template_id}"


@pytest.fixture(scope="module")
def inspect_template():
return dlp_pb2.InspectTemplate()
return dlp_v2.InspectTemplate()


@vpcsc_config.skip_unless_inside_vpcsc
Expand Down Expand Up @@ -219,22 +217,18 @@ def test_delete_inspect_template_outside(client, inspect_template_path_outside):
@pytest.fixture(scope="module")
def deidentify_template_path_inside(client):
deidentify_template_id = 1234567
return client.deidentify_template_path(
vpcsc_config.project_inside, deidentify_template_id
)
return f"projects/{vpcsc_config.project_inside}/deidentifyTemplates/{deidentify_template_id}"


@pytest.fixture(scope="module")
def deidentify_template_path_outside(client):
deidentify_template_id = 1234567
return client.deidentify_template_path(
vpcsc_config.project_outside, deidentify_template_id
)
return f"projects/{vpcsc_config.project_outside}/deidentifyTemplates/{deidentify_template_id}"


@pytest.fixture(scope="module")
def deidentify_template():
return dlp_pb2.DeidentifyTemplate()
return dlp_v2.DeidentifyTemplate()


@vpcsc_config.skip_unless_inside_vpcsc
Expand Down Expand Up @@ -339,7 +333,7 @@ def job_path_outside(name_outside):

@pytest.fixture(scope="module")
def inspect_job():
return dlp_pb2.InspectJobConfig()
return dlp_v2.InspectJobConfig()


@vpcsc_config.skip_unless_inside_vpcsc
Expand Down Expand Up @@ -422,7 +416,7 @@ def job_trigger_path_outside(client):

@pytest.fixture(scope="module")
def job_trigger():
return dlp_pb2.JobTrigger()
return dlp_v2.JobTrigger()


@vpcsc_config.skip_unless_inside_vpcsc
Expand Down Expand Up @@ -494,22 +488,18 @@ 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 client.stored_info_type_path(
vpcsc_config.project_inside, stored_info_type_id
)
return f"organizations/{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 client.stored_info_type_path(
vpcsc_config.project_outside, stored_info_type_id
)
return f"organizations/{vpcsc_config.project_outside}/storedInfoTypes/{stored_info_type_id}"


@pytest.fixture(scope="module")
def stored_info_type_config(client):
return dlp_pb2.StoredInfoTypeConfig()
return dlp_v2.StoredInfoTypeConfig()


@vpcsc_config.skip_unless_inside_vpcsc
Expand Down

0 comments on commit 59d9a2c

Please sign in to comment.