Added new tests for elasticsearch's and marketstore's initialization and stop

explicit_write_pps_on_exit
Esmeralda Gallardo 2023-02-21 13:29:35 -03:00 committed by Guillermo Rodriguez
parent b5cdf14036
commit 4122c482ba
No known key found for this signature in database
GPG Key ID: EC3AB66D5D83B392
1 changed files with 45 additions and 0 deletions

View File

@ -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)