mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 14:14:22 +01:00
Fixes and tests updates
Updates tests so they run with the db_manager and fixes some bugs introduced in d7d42c9.
This commit is contained in:
@@ -4,7 +4,10 @@ import requests
|
||||
from time import sleep
|
||||
from threading import Thread
|
||||
|
||||
from pisa.conf import DB_PATH
|
||||
from pisa.api import start_api
|
||||
from pisa.watcher import Watcher
|
||||
from pisa.db_manager import DBManager
|
||||
from test.simulator.bitcoind_sim import run_simulator, HOST, PORT
|
||||
|
||||
|
||||
@@ -20,7 +23,10 @@ def run_bitcoind():
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def run_api():
|
||||
api_thread = Thread(target=start_api)
|
||||
db_manager = DBManager(DB_PATH)
|
||||
watcher = Watcher(db_manager)
|
||||
|
||||
api_thread = Thread(target=start_api, args=[watcher])
|
||||
api_thread.daemon = True
|
||||
api_thread.start()
|
||||
|
||||
@@ -33,6 +39,11 @@ def prng_seed():
|
||||
random.seed(0)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def db_manager():
|
||||
return DBManager('test_db')
|
||||
|
||||
|
||||
def get_random_value_hex(nbytes):
|
||||
pseudo_random_value = random.getrandbits(8*nbytes)
|
||||
prv_hex = '{:x}'.format(pseudo_random_value)
|
||||
|
||||
Reference in New Issue
Block a user