From 772f634d1f7824315b58ed5aad5f42bfc2da1f8f Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Fri, 27 Mar 2020 14:47:59 +0100 Subject: [PATCH] Sets MAX_APPOINTMENTS for Watcher unit tests to a small testable value (100) --- test/teos/unit/test_watcher.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/teos/unit/test_watcher.py b/test/teos/unit/test_watcher.py index b219094..7645c80 100644 --- a/test/teos/unit/test_watcher.py +++ b/test/teos/unit/test_watcher.py @@ -40,6 +40,9 @@ config = get_config() 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") def temp_db_manager(): @@ -59,12 +62,7 @@ def watcher(db_manager): responder = Responder(db_manager, carrier, block_processor) watcher = Watcher( - db_manager, - block_processor, - responder, - signing_key.to_der(), - config.get("MAX_APPOINTMENTS"), - config.get("EXPIRY_DELTA"), + db_manager, block_processor, responder, signing_key.to_der(), MAX_APPOINTMENTS, config.get("EXPIRY_DELTA") ) chain_monitor = ChainMonitor( @@ -154,7 +152,7 @@ def test_add_too_many_appointments(watcher): # Any appointment on top of those should fail watcher.appointments = dict() - for _ in range(config.get("MAX_APPOINTMENTS")): + for _ in range(MAX_APPOINTMENTS): appointment, dispute_tx = generate_dummy_appointment( start_time_offset=START_TIME_OFFSET, end_time_offset=END_TIME_OFFSET )