def test_get_set_hl7v2_store_iam_policy(test_dataset, capsys):
    hl7v2_stores.create_hl7v2_store(service_account_json, project_id,
                                    cloud_region, dataset_id, hl7v2_store_id)

    get_response = hl7v2_stores.get_hl7v2_store_iam_policy(
        service_account_json, project_id, cloud_region, dataset_id,
        hl7v2_store_id)

    set_response = hl7v2_stores.set_hl7v2_store_iam_policy(
        service_account_json, project_id, cloud_region, dataset_id,
        hl7v2_store_id,
        'serviceAccount:[email protected]',
        'roles/viewer')

    # Clean up
    hl7v2_stores.delete_hl7v2_store(service_account_json, project_id,
                                    cloud_region, dataset_id, hl7v2_store_id)

    out, _ = capsys.readouterr()

    assert 'etag' in get_response
    assert 'bindings' in set_response
    assert len(set_response['bindings']) == 1
    assert 'python-docs-samples-tests' in str(set_response['bindings'])
    assert 'roles/viewer' in str(set_response['bindings'])
def test_patch_hl7v2_store(test_dataset, capsys):
    hl7v2_stores.create_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    hl7v2_stores.patch_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    # Clean up
    hl7v2_stores.delete_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    out, _ = capsys.readouterr()

    assert 'Patched HL7v2 store' in out
Exemplo n.º 3
0
def test_CRUD_hl7v2_store(test_dataset, capsys):
    hl7v2_stores.create_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    hl7v2_stores.get_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    hl7v2_stores.list_hl7v2_stores(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id)

    hl7v2_stores.delete_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    out, _ = capsys.readouterr()

    # Check that create/get/list/delete worked
    assert 'Created HL7v2 store' in out
    assert 'Name' in out
    assert 'hl7V2Stores' in out
    assert 'Deleted HL7v2 store' in out
def test_CRUD_hl7v2_store(test_dataset, capsys):
    hl7v2_stores.create_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    hl7v2_stores.get_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    hl7v2_stores.list_hl7v2_stores(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id)

    hl7v2_stores.delete_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    out, _ = capsys.readouterr()

    # Check that create/get/list/delete worked
    assert 'Created HL7v2 store' in out
    assert 'Name' in out
    assert 'hl7V2Stores' in out
    assert 'Deleted HL7v2 store' in out
Exemplo n.º 5
0
def test_patch_hl7v2_store(test_dataset, capsys):
    hl7v2_stores.create_hl7v2_store(
        service_account_json,
        api_key,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    hl7v2_stores.patch_hl7v2_store(
        service_account_json,
        api_key,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id,
        pubsub_topic)

    # Clean up
    hl7v2_stores.delete_hl7v2_store(
        service_account_json,
        api_key,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    out, _ = capsys.readouterr()

    assert 'Patched HL7v2 store' in out
Exemplo n.º 6
0
 def create():
     try:
         hl7v2_stores.create_hl7v2_store(project_id, cloud_region,
                                         dataset_id, hl7v2_store_id)
     except HttpError as err:
         # We ignore 409 conflict here, because we know it's most
         # likely the first request failed on the client side, but
         # the creation suceeded on the server side.
         if err.resp.status == 409:
             print("Got exception {} while creating HL7v2 store".format(
                 err.resp.status))
         else:
             raise
Exemplo n.º 7
0
def test_hl7v2_store():
    hl7v2_store = hl7v2_stores.create_hl7v2_store(service_account_json,
                                                  project_id, cloud_region,
                                                  dataset_id, hl7v2_store_id)

    yield hl7v2_store

    hl7v2_stores.delete_hl7v2_store(service_account_json, project_id,
                                    cloud_region, dataset_id, hl7v2_store_id)
Exemplo n.º 8
0
def test_CRUD_hl7v2_store(test_dataset, crud_hl7v2_store_id, capsys):
    hl7v2_stores.create_hl7v2_store(project_id, cloud_region, dataset_id,
                                    hl7v2_store_id)

    hl7v2_stores.get_hl7v2_store(project_id, cloud_region, dataset_id,
                                 hl7v2_store_id)

    hl7v2_stores.list_hl7v2_stores(project_id, cloud_region, dataset_id)

    hl7v2_stores.delete_hl7v2_store(project_id, cloud_region, dataset_id,
                                    hl7v2_store_id)

    out, _ = capsys.readouterr()

    # Check that create/get/list/delete worked
    assert "Created HL7v2 store" in out
    assert "Name" in out
    assert "hl7V2Stores" in out
    assert "Deleted HL7v2 store" in out
def test_get_set_hl7v2_store_iam_policy(test_dataset, capsys):
    hl7v2_stores.create_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    get_response = hl7v2_stores.get_hl7v2_store_iam_policy(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    set_response = hl7v2_stores.set_hl7v2_store_iam_policy(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id,
        'serviceAccount:[email protected]',
        'roles/viewer')

    # Clean up
    hl7v2_stores.delete_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    out, _ = capsys.readouterr()

    assert 'etag' in get_response
    assert 'bindings' in set_response
    assert len(set_response['bindings']) == 1
    assert 'python-docs-samples-tests' in str(set_response['bindings'])
    assert 'roles/viewer' in str(set_response['bindings'])
def test_hl7v2_store():
    hl7v2_store = hl7v2_stores.create_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)

    yield hl7v2_store

    hl7v2_stores.delete_hl7v2_store(
        service_account_json,
        project_id,
        cloud_region,
        dataset_id,
        hl7v2_store_id)
Exemplo n.º 11
0
 def create():
     hl7v2_stores.create_hl7v2_store(
         project_id, location, dataset_id, hl7v2_store_id
     )
Exemplo n.º 12
0
 def create():
     hl7v2_stores.create_hl7v2_store(project_id, cloud_region, dataset_id,
                                     hl7v2_store_id)