コード例 #1
0
def test_label_path():
    customer_id = "squid"
    label_id = "clam"
    expected = "customers/{customer_id}/labels/{label_id}".format(
        customer_id=customer_id,
        label_id=label_id,
    )
    actual = LabelServiceClient.label_path(customer_id, label_id)
    assert expected == actual
コード例 #2
0
def test_parse_label_path():
    expected = {
        "customer_id": "whelk",
        "label_id": "octopus",
    }
    path = LabelServiceClient.label_path(**expected)

    # Check that the path construction is reversible.
    actual = LabelServiceClient.parse_label_path(path)
    assert expected == actual