2 changed files with 20 additions and 0 deletions
@ -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…
Reference in new issue