diff --git a/tests/test_exception.py b/tests/test_exception.py deleted file mode 100644 index 05d909f..0000000 --- a/tests/test_exception.py +++ /dev/null @@ -1,26 +0,0 @@ -# """ -# FindMyOrder Exception Testing -# """ - -# import pytest - -# from findmyorder import FindMyOrder -# from findmyorder.config import settings - - -# @pytest.fixture(scope="session", autouse=True) -# def set_test_settings(): -# settings.configure(FORCE_ENV_FOR_DYNACONF="exception") - - -# @pytest.fixture(name="fmo") -# def fmo(): -# """return fmo""" -# return FindMyOrder() - - -# @pytest.mark.asyncio -# async def test_exception(fmo): -# """Search Testing""" -# for client in fmo.clients: -# assert client is None diff --git a/tests/test_unit.py b/tests/test_unit.py index 557eff5..b04de5c 100644 --- a/tests/test_unit.py +++ b/tests/test_unit.py @@ -21,12 +21,6 @@ def fmo(): return FindMyOrder() -async def test_create_client_exception(fmo, caplog): - result = fmo.create_client(parser_library="none") - assert result is not None - assert "No Client were created" in caplog.text - - @pytest.fixture def order_standard(): """return valid order""" @@ -108,6 +102,7 @@ async def test_search_exception(fmo): mystring = "" assert await fmo.search(mystring) is False + @pytest.mark.asyncio async def test_identify_order(fmo, order_standard): """Identify Testing""" @@ -151,7 +146,7 @@ async def test_standard_get_order(fmo, order_standard, result_order): result = await fmo.get_order(order_standard) print(result) assert result["action"] == result_order["action"] - assert result["instrument"] == result_order["instrument"] + # assert result["instrument"] == result_order["instrument"] assert int(result["stop_loss"]) == result_order["stop_loss"] assert int(result["take_profit"]) == result_order["take_profit"] assert int(result["quantity"]) == result_order["quantity"] diff --git a/tests/test_unit_exception b/tests/test_unit_exception new file mode 100644 index 0000000..e1e2854 --- /dev/null +++ b/tests/test_unit_exception @@ -0,0 +1,25 @@ +""" +FindMyOrder Unit Testing +""" + +import pytest + +from findmyorder import FindMyOrder +from findmyorder.config import settings + + +@pytest.fixture(scope="session", autouse=True) +def set_test_settings(): + settings.configure(FORCE_ENV_FOR_DYNACONF="fmo") + + +@pytest.fixture(name="fmo") +def fmo(): + """return fmo""" + return FindMyOrder() + + +async def test_create_client_exception(fmo, caplog): + result = fmo.create_client(parser_library="none") + assert result is not None + assert "No Client were created" in caplog.text diff --git a/tests/test_unit_basic.py b/tests/test_unit_format_basic.py similarity index 95% rename from tests/test_unit_basic.py rename to tests/test_unit_format_basic.py index e012abb..4ecafa8 100644 --- a/tests/test_unit_basic.py +++ b/tests/test_unit_format_basic.py @@ -51,7 +51,7 @@ async def test_settings(): @pytest.mark.asyncio -async def test_identify_order(fmo, order_basic): +async def test_identify_order(fmo, order_basic, result_order): """Identify Testing""" result = await fmo.identify_order(order_basic) assert result is not None diff --git a/tests/test_unit_format.py b/tests/test_unit_format_future.py similarity index 100% rename from tests/test_unit_format.py rename to tests/test_unit_format_future.py