Skip to content

Commit

Permalink
Fix: Fixed unit tests and type mismatching for float.
Browse files Browse the repository at this point in the history
  • Loading branch information
nesitor committed Dec 6, 2023
1 parent 4515800 commit d1b5f2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/api/test_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions tests/message_processing/test_process_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d1b5f2b

Please sign in to comment.