mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 14:14:22 +01:00
Merge branch 'master' into chainmonitor
This commit is contained in:
@@ -9,7 +9,6 @@ from pisa.api import API
|
||||
from pisa.watcher import Watcher
|
||||
from pisa.tools import bitcoin_cli
|
||||
from pisa import HOST, PORT
|
||||
from pisa.conf import MAX_APPOINTMENTS
|
||||
|
||||
from test.pisa.unit.conftest import (
|
||||
generate_block,
|
||||
@@ -17,6 +16,7 @@ from test.pisa.unit.conftest import (
|
||||
get_random_value_hex,
|
||||
generate_dummy_appointment_data,
|
||||
generate_keypair,
|
||||
get_config,
|
||||
)
|
||||
|
||||
from common.constants import LOCATOR_LEN_BYTES
|
||||
@@ -28,6 +28,8 @@ MULTIPLE_APPOINTMENTS = 10
|
||||
appointments = []
|
||||
locator_dispute_tx_map = {}
|
||||
|
||||
config = get_config()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def run_api(db_manager, chain_monitor):
|
||||
@@ -38,11 +40,11 @@ def run_api(db_manager, chain_monitor):
|
||||
encryption_algorithm=serialization.NoEncryption(),
|
||||
)
|
||||
|
||||
watcher = Watcher(db_manager, chain_monitor, sk_der)
|
||||
watcher = Watcher(db_manager, chain_monitor, sk_der, get_config())
|
||||
chain_monitor.attach_watcher(watcher.block_queue, watcher.asleep)
|
||||
chain_monitor.attach_responder(watcher.responder.block_queue, watcher.responder.asleep)
|
||||
|
||||
api_thread = Thread(target=API(watcher).start)
|
||||
api_thread = Thread(target=API(watcher, config).start)
|
||||
api_thread.daemon = True
|
||||
api_thread.start()
|
||||
|
||||
@@ -105,7 +107,7 @@ def test_request_multiple_appointments_same_locator(new_appt_data, n=MULTIPLE_AP
|
||||
|
||||
|
||||
def test_add_too_many_appointment(new_appt_data):
|
||||
for _ in range(MAX_APPOINTMENTS - len(appointments)):
|
||||
for _ in range(config.get("MAX_APPOINTMENTS") - len(appointments)):
|
||||
r = add_appointment(new_appt_data)
|
||||
assert r.status_code == 200
|
||||
|
||||
|
||||
Reference in New Issue
Block a user