def test_create(test_subscription): subscriber.create_subscription( test_subscription.topic.name, test_subscription.name) @eventually_consistent.call def _(): assert test_subscription.exists()
def test_create(test_subscription): subscriber.create_subscription(test_subscription.topic.name, test_subscription.name) @eventually_consistent.call def _(): assert test_subscription.exists()
def test_create(subscriber_client): subscription_path = subscriber_client.subscription_path( PROJECT, SUBSCRIPTION) try: subscriber_client.delete_subscription(subscription_path) except Exception: pass subscriber.create_subscription(PROJECT, TOPIC, SUBSCRIPTION) @eventually_consistent.call def _(): assert subscriber_client.get_subscription(subscription_path)
def test_create(subscriber_client): subscription_path = subscriber_client.subscription_path( PROJECT, SUBSCRIPTION) try: subscriber_client.delete_subscription(subscription_path) except Exception: pass subscriber.create_subscription(PROJECT, TOPIC, SUBSCRIPTION) @eventually_consistent.call def _(): assert subscriber_client.get_subscription(subscription_path)
def test_create(subscriber_client, subscription_admin, capsys): subscription_path = subscriber_client.subscription_path( PROJECT_ID, SUBSCRIPTION_ADMIN) try: subscriber_client.delete_subscription( request={"subscription": subscription_path}) except NotFound: pass subscriber.create_subscription(PROJECT_ID, TOPIC, SUBSCRIPTION_ADMIN) out, _ = capsys.readouterr() assert f"{subscription_admin}" in out
def test_create(subscriber_client): subscription_path = subscriber_client.subscription_path(PROJECT, SUBSCRIPTION_ADMIN) try: subscriber_client.delete_subscription(subscription_path) except Exception: pass subscriber.create_subscription(PROJECT, TOPIC, SUBSCRIPTION_ADMIN) @backoff.on_exception(backoff.expo, AssertionError, max_time=60) def eventually_consistent_test(): assert subscriber_client.get_subscription(subscription_path) eventually_consistent_test()
from subscriber import create_subscription from publisher import create_topic project_id = "my-fast-trace-project1" topic_name = "TEST_TOPIC_ID" subscription_name = "number-one-sub-1" topic_res = create_topic(project_id, topic_name) subsction_res = create_subscription(project_id, topic_name, subscription_name)