From d1b5f2b148408e1735963a0e62dd1274bf917b15 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Wed, 6 Dec 2023 13:04:21 +0100 Subject: [PATCH] Fix: Fixed unit tests and type mismatching for float. --- tests/api/test_balance.py | 2 +- tests/message_processing/test_process_instances.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/api/test_balance.py b/tests/api/test_balance.py index 3e1ac8828..277c2b3ae 100644 --- a/tests/api/test_balance.py +++ b/tests/api/test_balance.py @@ -27,4 +27,4 @@ async def test_get_balance( assert response.status == 200, await response.text() data = await response.json() assert data["balance"] == user_balance.balance - assert data["locked_amount"] == 2720.6666666666665 + assert data["locked_amount"] == 2002.4666666666665 diff --git a/tests/message_processing/test_process_instances.py b/tests/message_processing/test_process_instances.py index 8e2ee7dc4..6d38a83e6 100644 --- a/tests/message_processing/test_process_instances.py +++ b/tests/message_processing/test_process_instances.py @@ -497,10 +497,10 @@ async def test_compare_cost_view_with_cost_function( content = InstanceContent.parse_raw(fixture_instance_message.item_content) with session_factory() as session: - cost_from_function = compute_cost(session=session, content=content) + cost_from_function: Decimal = compute_cost(session=session, content=content) cost_from_view = session.execute( text("SELECT total_price from vm_costs_view WHERE vm_hash = :vm_hash"), {"vm_hash": fixture_instance_message.item_hash}, ).scalar_one() - assert cost_from_view == cost_from_function + assert Decimal(str(cost_from_view)) == cost_from_function