def test_create(client): topic_path = client.topic_path(PROJECT, TOPIC) try: client.delete_topic(topic_path) except Exception: pass publisher.create_topic(PROJECT, TOPIC) @eventually_consistent.call def _(): assert client.get_topic(topic_path)
def test_create(client): topic_path = client.topic_path(PROJECT, TOPIC) try: client.delete_topic(topic_path) except: pass publisher.create_topic(PROJECT, TOPIC) @eventually_consistent.call def _(): assert client.get_topic(topic_path)
def test_create(publisher_client, capsys): # The scope of `topic_path` is limited to this function. topic_path = publisher_client.topic_path(PROJECT_ID, TOPIC_ID) try: publisher_client.delete_topic(request={"topic": topic_path}) except NotFound: pass publisher.create_topic(PROJECT_ID, TOPIC_ID) out, _ = capsys.readouterr() assert f"Created topic: {topic_path}" in out
def test_create(client): topic_path = client.topic_path(PROJECT, TOPIC_ADMIN) try: client.delete_topic(topic_path) except Exception: pass publisher.create_topic(PROJECT, TOPIC_ADMIN) @backoff.on_exception(backoff.expo, AssertionError, max_time=60) def eventually_consistent_test(): assert client.get_topic(topic_path) eventually_consistent_test()
def test_create(test_topic): publisher.create_topic(test_topic.name) @eventually_consistent.call def _(): assert test_topic.exists()
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)