From d6e37a7d61ebc9d6dd467f77e3ea3e0ea0b6a400 Mon Sep 17 00:00:00 2001 From: mraniki Date: Wed, 9 Aug 2023 22:17:29 +0200 Subject: [PATCH] :white_check_mark: --- tests/test_unit.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/test_unit.py b/tests/test_unit.py index f2dd58a9..945c15a9 100644 --- a/tests/test_unit.py +++ b/tests/test_unit.py @@ -13,18 +13,12 @@ def set_test_settings_CEX(): settings.configure(FORCE_ENV_FOR_DYNACONF="testingbinancecex") -@pytest.fixture(name="order_message") -def order(): - """return valid order""" - return "buy BTCUSDT sl=200 tp=400 q=1%" - - @pytest.fixture(name="order_parsed") def result_order(): """return standard expected results""" return { "action": "BUY", - "instrument": "EURUSD", + "instrument": "BTCUSDT", "stop_loss": 200, "take_profit": 400, "quantity": 2, @@ -71,7 +65,7 @@ async def test_parse_quote(exchange, caplog): """Test parse_message balance""" result = await exchange.get_quote("BTCUSDT") assert result is not None - #assert "🏦" in caplog.text + assert "🏦" in caplog.text @pytest.mark.asyncio @@ -124,12 +118,20 @@ async def test_get_help(exchange): assert "🏦" in result +@pytest.mark.asyncio +async def test_position(exchange, caplog): + """Test position""" + + result = await exchange.get_account_position() + assert result is not None + @pytest.mark.asyncio async def test_execute_order(exchange, order_parsed): result = await exchange.execute_order(order_parsed) print(result) assert result is not None - assert "⚠️ order execution" in result + assert "⬆️" in result + #assert "⚠️ order execution" in result # @pytest.mark.asyncio