Browse Source

test: test orders usd amount

pull/14/head
QuentinN42 1 year ago
parent
commit
40df433c9d
Signed by: number42 GPG Key ID: 2CD7D563712B3A50
  1. 0
      tests/orders/__init__.py
  2. 20
      tests/orders/test_orders.py

0
tests/orders/__init__.py

20
tests/orders/test_orders.py

@ -0,0 +1,20 @@
import pytest
from typing import Union
from auto_trading.orders import Short, Long
@pytest.mark.parametrize(
"order, usd",
[
(Long("BTC", 1, 1), 1),
(Short("BTC", 1, 1), 1),
(Long("BTC", 1, 10), 10),
(Short("BTC", 1, 10), 10),
(Long("BTC", 10, 1), 10),
(Short("BTC", 10, 1), 10),
],
)
def test_order_usd(order: Union[Long, Short], usd: float):
"""Test the USD value of an order."""
assert order.amount_usd == usd
Loading…
Cancel
Save