mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 22:24:23 +01:00
Sets MAX_APPOINTMENTS for Watcher unit tests to a small testable value (100)
This commit is contained in:
@@ -40,6 +40,9 @@ config = get_config()
|
|||||||
|
|
||||||
signing_key, public_key = generate_keypair()
|
signing_key, public_key = generate_keypair()
|
||||||
|
|
||||||
|
# Reduce the maximum number of appointments to something we can test faster
|
||||||
|
MAX_APPOINTMENTS = 100
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def temp_db_manager():
|
def temp_db_manager():
|
||||||
@@ -59,12 +62,7 @@ def watcher(db_manager):
|
|||||||
|
|
||||||
responder = Responder(db_manager, carrier, block_processor)
|
responder = Responder(db_manager, carrier, block_processor)
|
||||||
watcher = Watcher(
|
watcher = Watcher(
|
||||||
db_manager,
|
db_manager, block_processor, responder, signing_key.to_der(), MAX_APPOINTMENTS, config.get("EXPIRY_DELTA")
|
||||||
block_processor,
|
|
||||||
responder,
|
|
||||||
signing_key.to_der(),
|
|
||||||
config.get("MAX_APPOINTMENTS"),
|
|
||||||
config.get("EXPIRY_DELTA"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
chain_monitor = ChainMonitor(
|
chain_monitor = ChainMonitor(
|
||||||
@@ -154,7 +152,7 @@ def test_add_too_many_appointments(watcher):
|
|||||||
# Any appointment on top of those should fail
|
# Any appointment on top of those should fail
|
||||||
watcher.appointments = dict()
|
watcher.appointments = dict()
|
||||||
|
|
||||||
for _ in range(config.get("MAX_APPOINTMENTS")):
|
for _ in range(MAX_APPOINTMENTS):
|
||||||
appointment, dispute_tx = generate_dummy_appointment(
|
appointment, dispute_tx = generate_dummy_appointment(
|
||||||
start_time_offset=START_TIME_OFFSET, end_time_offset=END_TIME_OFFSET
|
start_time_offset=START_TIME_OFFSET, end_time_offset=END_TIME_OFFSET
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user