0965e26c69430ef1a571abf360547002a4bbfa57,dlp/inspect_content_test.py,,test_inspect_gcs_file,#,292

Before Change


    out, _ = capsys.readouterr()
    assert "Inspection operation started" in out
    // Cancel the operation
    operation_id = out.split("Inspection operation started: ")[1].split("\n")[0]
    print(operation_id)
    client = google.cloud.dlp_v2.DlpServiceClient()
    client.cancel_dlp_job(operation_id)


def test_inspect_gcs_file_with_custom_info_types(
    bucket, topic_id, subscription_id, capsys

After Change




def test_inspect_gcs_file(bucket, topic_id, subscription_id, capsys):
    try:
        inspect_content.inspect_gcs_file(
            GCLOUD_PROJECT,
            bucket.name,
            "test.txt",
            topic_id,
            subscription_id,
            ["EMAIL_ADDRESS", "PHONE_NUMBER"],
            timeout=1
        )

        out, _ = capsys.readouterr()
        assert "Inspection operation started" in out
    finally:
        cancel_operation(out)


def test_inspect_gcs_file_with_custom_info_types(
        bucket, topic_id, subscription_id, capsys):
    try:
        dictionaries = ["gary@somedomain.com"]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 13

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 0965e26c69430ef1a571abf360547002a4bbfa57
Time: 2020-04-17
Author: tmatsuo@google.com
File Name: dlp/inspect_content_test.py
Class Name:
Method Name: test_inspect_gcs_file


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 0965e26c69430ef1a571abf360547002a4bbfa57
Time: 2020-04-17
Author: tmatsuo@google.com
File Name: dlp/inspect_content_test.py
Class Name:
Method Name: test_inspect_gcs_file_no_results


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 0965e26c69430ef1a571abf360547002a4bbfa57
Time: 2020-04-17
Author: tmatsuo@google.com
File Name: dlp/inspect_content_test.py
Class Name:
Method Name: test_inspect_gcs_multiple_files


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 0965e26c69430ef1a571abf360547002a4bbfa57
Time: 2020-04-17
Author: tmatsuo@google.com
File Name: dlp/inspect_content_test.py
Class Name:
Method Name: test_inspect_gcs_file_with_custom_info_types