diff --git a/findmyorder/main.py b/findmyorder/main.py index b7eae05..44979b5 100644 --- a/findmyorder/main.py +++ b/findmyorder/main.py @@ -159,39 +159,9 @@ async def search(self, message: str) -> bool: """ for client in self.clients: - yield await client.search() - - async def identify_order( - self, - my_string: str, - ) -> dict: - """ - Identify an order and return a dictionary - with the order parameters - - Args: - my_string (str): Message - - Returns: - dict - - """ - for client in self.clients: - yield client.identify_order() - - async def replace_instrument(self, order): - """ - Replace instrument by an alternative instrument, if the - instrument is not in the mapping, it will be ignored. - - Args: - order (dict): - - Returns: - dict - """ - for client in self.clients: - yield client.replace_instrument() + if await client.search(message): + return True + return False async def get_order( self, @@ -208,5 +178,8 @@ async def get_order( dict """ + results = [] for client in self.clients: - yield await client.get_order() + result = await client.get_order(msg) + results.append(result) + return results diff --git a/tests/test_unit.py b/tests/test_unit.py index 3853c89..73066d1 100644 --- a/tests/test_unit.py +++ b/tests/test_unit.py @@ -15,7 +15,6 @@ def set_test_settings(): settings.configure(FORCE_ENV_FOR_DYNACONF="fmo") - @pytest.fixture(name="fmo") def fmo(): """return fmo""" @@ -139,7 +138,7 @@ async def test_info(fmo): result = await fmo.get_info() print(result) assert result is not None - assert str(result).startswith("FindMyOrder") + assert "FindMyOrder" in result @pytest.mark.asyncio