def test_realm():
    realm_id = realm_id_format.format(uuid.uuid4().hex, int(time.time()))

    print(
        f"Creating realm {realm_id} in location {REALM_LOCATION} in project {PROJECT_ID}"
    )
    create_realm.create_realm(PROJECT_ID, REALM_LOCATION, realm_id)

    yield realm_id

    print(f"Cleaning up realm {realm_id} in teardown")
    clean_up_realm(realm_id)
def test_realm_with_cluster():
    realm_id = realm_id_format.format(uuid.uuid4().hex, int(time.time()))

    print(
        f"Creating realm {realm_id} in location {REALM_LOCATION} in project {PROJECT_ID}"
    )
    create_realm.create_realm(PROJECT_ID, REALM_LOCATION, realm_id)

    print(f"Creating cluster {CLUSTER_ID} in realm {realm_id} in project {PROJECT_ID}")
    create_cluster.create_cluster(
        PROJECT_ID, REALM_LOCATION, realm_id, CLUSTER_ID, GKE_CLUSTER_NAME
    )

    yield realm_id

    print(f"Cleaning up realm {realm_id} in teardown")
    clean_up_realm_and_clusters(realm_id)