def test_ad_path(): customer = "squid" ad = "clam" expected = "customers/{customer}/ads/{ad}".format( customer=customer, ad=ad, ) actual = RecommendationServiceClient.ad_path(customer, ad) assert expected == actual
def test_parse_ad_path(): expected = { "customer": "whelk", "ad": "octopus", } path = RecommendationServiceClient.ad_path(**expected) # Check that the path construction is reversible. actual = RecommendationServiceClient.parse_ad_path(path) assert expected == actual