コード例 #1
0
def test_asset_path():
    customer_id = "squid"
    asset_id = "clam"
    expected = "customers/{customer_id}/assets/{asset_id}".format(
        customer_id=customer_id,
        asset_id=asset_id,
    )
    actual = CustomerAssetServiceClient.asset_path(customer_id, asset_id)
    assert expected == actual
コード例 #2
0
def test_parse_asset_path():
    expected = {
        "customer_id": "whelk",
        "asset_id": "octopus",
    }
    path = CustomerAssetServiceClient.asset_path(**expected)

    # Check that the path construction is reversible.
    actual = CustomerAssetServiceClient.parse_asset_path(path)
    assert expected == actual