From 4122c482ba35443a859259df8175674ae3a89b2f Mon Sep 17 00:00:00 2001 From: Esmeralda Gallardo Date: Tue, 21 Feb 2023 13:29:35 -0300 Subject: [PATCH] Added new tests for elasticsearch's and marketstore's initialization and stop --- tests/test_databases.py | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tests/test_databases.py diff --git a/tests/test_databases.py b/tests/test_databases.py new file mode 100644 index 00000000..32e9bbc1 --- /dev/null +++ b/tests/test_databases.py @@ -0,0 +1,45 @@ +import pytest +import trio + +from typing import AsyncContextManager + +from piker._daemon import Services +from piker.log import get_logger + + +# def test_marketstore( open_test_pikerd: AsyncContextManager): + +''' +Verify marketstore starts and closes correctly + +''' + + +def test_elasticsearch( + open_test_pikerd: AsyncContextManager, +): + ''' + Verify elasticsearch starts and closes correctly + + ''' + + # log = get_logger(__name__) + + # log.info('#################### Starting test ####################') + + async def main(): + port = 19200 + daemon_addr = ('127.0.0.1', port) + + async with ( + open_test_pikerd( + tsdb=False, + es=True, + reg_addr=daemon_addr, + ) as (s, i, pikerd_portal, services), + # pikerd(), + ): + assert pikerd_portal.channel.raddr == daemon_addr + + + trio.run(main) \ No newline at end of file