def test_compare_product_missing(lambda_module, product):
    retval = lambda_module.compare_product(product, None)

    assert retval is not None
    assert retval[0] == product
    assert isinstance(retval[1], str)
    assert retval[1].find(product["productId"]) != -1
def test_compare_product_correct(lambda_module, product):
    """
    Compare a product that matches the DynamoDB item
    """

    retval = lambda_module.compare_product(product, product)

    assert retval is None
def test_compare_product_wrong_price(lambda_module, product):
    user_product = copy.deepcopy(product)
    user_product["price"] += 100

    retval = lambda_module.compare_product(user_product, product)

    assert retval is not None
    assert retval[0] == product
    assert isinstance(retval[1], str)
    assert retval[1].find(product["productId"]) != -1