Fixed UnboundLocalError on _ahab. Added test for marketstore's initialization
parent
acc6249d88
commit
f96d6a04b6
|
@ -7,28 +7,48 @@ from piker._daemon import Services
|
||||||
from piker.log import get_logger
|
from piker.log import get_logger
|
||||||
|
|
||||||
from elasticsearch import Elasticsearch
|
from elasticsearch import Elasticsearch
|
||||||
|
from piker.data import marketstore
|
||||||
|
|
||||||
|
def test_marketstore(
|
||||||
# def test_marketstore( open_test_pikerd: AsyncContextManager):
|
open_test_pikerd: AsyncContextManager,
|
||||||
|
):
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Verify marketstore starts and closes correctly
|
Verify marketstore starts correctly
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
log = get_logger(__name__)
|
||||||
|
|
||||||
|
async def main():
|
||||||
|
# port = 5995
|
||||||
|
|
||||||
|
async with (
|
||||||
|
open_test_pikerd(
|
||||||
|
loglevel='info',
|
||||||
|
tsdb=True
|
||||||
|
) as (s, i, pikerd_portal, services),
|
||||||
|
marketstore.get_client() as client
|
||||||
|
):
|
||||||
|
|
||||||
|
assert (
|
||||||
|
len(await client.server_version()) ==
|
||||||
|
len('3862e9973da36cfc6004b88172c08f09269aaf01')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
trio.run(main)
|
||||||
|
|
||||||
|
|
||||||
def test_elasticsearch(
|
def test_elasticsearch(
|
||||||
open_test_pikerd: AsyncContextManager,
|
open_test_pikerd: AsyncContextManager,
|
||||||
):
|
):
|
||||||
'''
|
'''
|
||||||
Verify elasticsearch starts and closes correctly
|
Verify elasticsearch starts correctly
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
log = get_logger(__name__)
|
log = get_logger(__name__)
|
||||||
|
|
||||||
# log.info('#################### Starting test ####################')
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
port = 19200
|
port = 19200
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue