reorganize the library into three folders lib, contrib and core

Write unittests with pytest
Make all functions and method signatures as keyword only arguments
This commit is contained in:
Ichinga Samuel
2024-10-06 23:20:59 +01:00
parent 9b55214d1a
commit 76a947640f
68 changed files with 1439 additions and 817 deletions
+27
View File
@@ -0,0 +1,27 @@
from aiomql.lib.order import Order
class TestOrder:
async def test_check(self, sell_order):
order = Order(**sell_order)
check = await order.check()
assert check.retcode == 0
async def test_send(self, buy_order):
order = Order(**buy_order)
send = await order.send()
assert send.retcode == 10009
async def test_margin(self, buy_order):
order = Order(**buy_order)
margin = await order.calc_margin()
assert margin is not None
assert margin > 0
assert isinstance(margin, float)
async def test_profit(self, buy_order):
order = Order(**buy_order)
profit = await order.calc_profit()
assert profit is not None
assert profit > 0
assert isinstance(profit, float)