def test_get_payment_token_no_item(lambda_module, order_id, payment_token): """ Test get_payment_token() without an item """ table = mock_table(lambda_module.table, action="get_item", keys=["orderId"]) try: lambda_module.get_payment_token(order_id) assert 1 == 2 except: pass table.assert_no_pending_responses() table.deactivate()
def test_get_payment_token(lambda_module, order_id, payment_token): """ Test get_payment_token() """ table = mock_table(lambda_module.table, action="get_item", keys=["orderId"], items={ "orderId": order_id, "paymentToken": payment_token }) response = lambda_module.get_payment_token(order_id) assert response == payment_token table.assert_no_pending_responses() table.deactivate()