Beispiel #1
0
def test_ad_path():
    customer_id = "squid"
    ad_id = "clam"
    expected = "customers/{customer_id}/ads/{ad_id}".format(
        customer_id=customer_id,
        ad_id=ad_id,
    )
    actual = AdServiceClient.ad_path(customer_id, ad_id)
    assert expected == actual
Beispiel #2
0
def test_parse_ad_path():
    expected = {
        "customer_id": "whelk",
        "ad_id": "octopus",
    }
    path = AdServiceClient.ad_path(**expected)

    # Check that the path construction is reversible.
    actual = AdServiceClient.parse_ad_path(path)
    assert expected == actual