Example #1
0
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
Example #2
0
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