예제 #1
0
def test_parse_topic_path():
    expected = {
        "project": "octopus",
        "location": "oyster",
        "topic": "nudibranch",
    }
    path = TopicStatsServiceClient.topic_path(**expected)

    # Check that the path construction is reversible.
    actual = TopicStatsServiceClient.parse_topic_path(path)
    assert expected == actual
예제 #2
0
def test_topic_path():
    project = "squid"
    location = "clam"
    topic = "whelk"

    expected = "projects/{project}/locations/{location}/topics/{topic}".format(
        project=project,
        location=location,
        topic=topic,
    )
    actual = TopicStatsServiceClient.topic_path(project, location, topic)
    assert expected == actual