def test_invoice_path(): customer_id = "squid" invoice_id = "clam" expected = "customers/{customer_id}/invoices/{invoice_id}".format( customer_id=customer_id, invoice_id=invoice_id, ) actual = InvoiceServiceClient.invoice_path(customer_id, invoice_id) assert expected == actual
def test_parse_invoice_path(): expected = { "customer_id": "whelk", "invoice_id": "octopus", } path = InvoiceServiceClient.invoice_path(**expected) # Check that the path construction is reversible. actual = InvoiceServiceClient.parse_invoice_path(path) assert expected == actual