From b8deab5d763ea3a17296fedd7ed6956584517806 Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Tue, 11 Jul 2023 20:19:30 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20=20added=20unit=20test=20for=20get?= =?UTF-8?q?=5Finfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_unit.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/test_unit.py b/tests/test_unit.py index a9a76b6c..216aff2f 100644 --- a/tests/test_unit.py +++ b/tests/test_unit.py @@ -4,12 +4,9 @@ from datetime import datetime import pytest -from unittest.mock import patch from findmyorder import FindMyOrder, settings - - @pytest.fixture(scope="session", autouse=True) def set_test_settings(): settings.configure(FORCE_ENV_FOR_DYNACONF="testing") @@ -98,9 +95,17 @@ def invalid_order(): async def test_settings(): """Search Testing""" assert settings.VALUE == "On Testing" - assert settings.findmyorder_enabled == True + assert settings.findmyorder_enabled is True +@pytest.mark.asyncio +async def test_info(fmo): + """Search Testing""" + result = await fmo.get_info() + print(result) + assert result is not None + assert str(result).startswith("FindMyOrder") + @pytest.mark.asyncio async def test_search_valid_order(fmo, crypto_order): """Search Testing""" @@ -179,7 +184,7 @@ async def test_short_valid_get_order(fmo, short_order, result_order): @pytest.mark.asyncio -async def test_ignoteorder(fmo, ignore_order): +async def test_ignore_eorder(fmo, ignore_order): """ignore order Testing""" result = await fmo.get_order(ignore_order) assert result is None @@ -193,10 +198,11 @@ async def test_mapping_order( """replace instrument Testing""" result = await fmo.get_order(crypto_short_order) print(result) - assert settings.instrument_mapping == True + assert settings.instrument_mapping is True assert result["instrument"] == result_crypto_order["instrument"] assert type(result["timestamp"] is datetime) + @pytest.mark.asyncio async def test_contains_no_emoji(fmo, order): """check emoji""" @@ -226,4 +232,3 @@ def func_that_raises(): # Check that the function returned None assert result is None -