Skip to content

Commit

Permalink
[Tests] check closed orders after order creation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume De Saint Martin authored and GuillaumeDSM committed Jan 2, 2023
1 parent 12e846f commit 001f072
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 78 deletions.
36 changes: 18 additions & 18 deletions exchanges_tests/abstract_authenticated_exchange_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,6 @@ async def test_get_portfolio(self):
async def inner_test_get_portfolio(self):
self.check_portfolio_content(await self.get_portfolio())

async def test_get_my_recent_trades(self):
async with self.local_exchange_manager():
await self.inner_test_get_my_recent_trades()

async def inner_test_get_my_recent_trades(self):
trades = await self.get_my_recent_trades()
assert trades
self.check_raw_trades(trades)

async def test_get_closed_orders(self):
async with self.local_exchange_manager():
await self.inner_test_get_closed_orders()

async def inner_test_get_closed_orders(self):
orders = await self.get_closed_orders()
assert orders
self.check_raw_closed_orders(orders)

async def test_create_and_cancel_limit_orders(self):
async with self.local_exchange_manager():
await self.inner_test_create_and_cancel_limit_orders()
Expand Down Expand Up @@ -135,6 +117,24 @@ async def inner_test_create_and_cancel_stop_orders(self):
await self.wait_for_cancel(stop_loss)
assert await self.order_not_in_open_orders(open_orders, stop_loss)

async def test_get_my_recent_trades(self):
async with self.local_exchange_manager():
await self.inner_test_get_my_recent_trades()

async def inner_test_get_my_recent_trades(self):
trades = await self.get_my_recent_trades()
assert trades
self.check_raw_trades(trades)

async def test_get_closed_orders(self):
async with self.local_exchange_manager():
await self.inner_test_get_closed_orders()

async def inner_test_get_closed_orders(self):
orders = await self.get_closed_orders()
assert orders
self.check_raw_closed_orders(orders)

async def test_edit_limit_order(self):
# pass if not implemented
async with self.local_exchange_manager():
Expand Down
12 changes: 6 additions & 6 deletions exchanges_tests/test_ascendex.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ class TestAscendexAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_limit_orders(self):
await super().test_create_and_cancel_limit_orders()

async def test_create_and_fill_market_orders(self):
await super().test_create_and_fill_market_orders()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_stop_orders(self):
# pass if not implemented
pass
Expand Down
12 changes: 6 additions & 6 deletions exchanges_tests/test_binance.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ class TestBinanceAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_limit_orders(self):
await super().test_create_and_cancel_limit_orders()

async def test_create_and_fill_market_orders(self):
await super().test_create_and_fill_market_orders()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_stop_orders(self):
# pass if not implemented
pass
Expand Down
12 changes: 6 additions & 6 deletions exchanges_tests/test_bitget.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ class TestBitgetAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_limit_orders(self):
await super().test_create_and_cancel_limit_orders()

async def test_create_and_fill_market_orders(self):
await super().test_create_and_fill_market_orders()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_stop_orders(self):
# pass if not implemented
pass
Expand Down
12 changes: 6 additions & 6 deletions exchanges_tests/test_bybit.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ class TestBybitAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_get_empty_linear_and_inverse_positions(self):
await super().test_get_empty_linear_and_inverse_positions()

Expand All @@ -50,6 +44,12 @@ async def test_create_and_cancel_limit_orders(self):
async def test_create_and_fill_market_orders(self):
await super().test_create_and_fill_market_orders()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_stop_orders(self):
# pass if not implemented
await super().test_create_and_cancel_stop_orders()
Expand Down
12 changes: 6 additions & 6 deletions exchanges_tests/test_coinbasepro.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ class TestCoinbaseproAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_limit_orders(self):
await super().test_create_and_cancel_limit_orders()

async def test_create_and_fill_market_orders(self):
await super().test_create_and_fill_market_orders()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_stop_orders(self):
# pass if not implemented
pass
Expand Down
12 changes: 6 additions & 6 deletions exchanges_tests/test_hollaex.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ class TestHollaexAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_limit_orders(self):
await super().test_create_and_cancel_limit_orders()

async def test_create_and_fill_market_orders(self):
await super().test_create_and_fill_market_orders()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_stop_orders(self):
# pass if not implemented
pass
Expand Down
12 changes: 6 additions & 6 deletions exchanges_tests/test_huobi.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ class TestHuobiAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_limit_orders(self):
await super().test_create_and_cancel_limit_orders()

async def test_create_and_fill_market_orders(self):
await super().test_create_and_fill_market_orders()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_stop_orders(self):
# pass if not implemented
pass
Expand Down
12 changes: 6 additions & 6 deletions exchanges_tests/test_kucoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ class TestKucoinAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_limit_orders(self):
await super().test_create_and_cancel_limit_orders()

async def test_create_and_fill_market_orders(self):
await super().test_create_and_fill_market_orders()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_stop_orders(self):
# pass if not implemented
pass
Expand Down
12 changes: 6 additions & 6 deletions exchanges_tests/test_okx.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ class TestOKXAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_limit_orders(self):
await super().test_create_and_cancel_limit_orders()

async def test_create_and_fill_market_orders(self):
await super().test_create_and_fill_market_orders()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_stop_orders(self):
# pass if not implemented
pass
Expand Down
12 changes: 6 additions & 6 deletions exchanges_tests/test_phemex.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ class TestPemexAuthenticatedExchange(
async def test_get_portfolio(self):
await super().test_get_portfolio()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_limit_orders(self):
# 08 dec 2022: did not run so far, testnet is bugged: order are apparently accepted but never show up
await super().test_create_and_cancel_limit_orders()
Expand All @@ -48,6 +42,12 @@ async def test_create_and_fill_market_orders(self):
# 08 dec 2022: did not run so far, testnet is bugged: order are apparently accepted but never show up
await super().test_create_and_fill_market_orders()

async def test_get_my_recent_trades(self):
await super().test_get_my_recent_trades()

async def test_get_closed_orders(self):
await super().test_get_closed_orders()

async def test_create_and_cancel_stop_orders(self):
# pass if not implemented
pass
Expand Down

0 comments on commit 001f072

Please sign in to comment.