From 3e62cb4b7002c38ccb92f66f96fc2d7e41909c29 Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Wed, 16 Oct 2019 12:42:50 +0100 Subject: [PATCH] Parametrize start and end appointment offsets Also waits an additional for transactions to be cleaned to be safe --- test/unit/test_watcher.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/unit/test_watcher.py b/test/unit/test_watcher.py index a0b7ac5..9ddcbb5 100644 --- a/test/unit/test_watcher.py +++ b/test/unit/test_watcher.py @@ -18,6 +18,8 @@ from pisa.conf import EXPIRY_DELTA, BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, logging.getLogger().disabled = True APPOINTMENTS = 5 +START_TIME_OFFSET = 1 +END_TIME_OFFSET = 1 @pytest.fixture(scope="module") @@ -125,7 +127,7 @@ def test_do_watch(watcher): # After leaving some time for the block to be mined and processed, the number of appointments should have reduced # by two - sleep(TIME_BETWEEN_BLOCKS*2) + sleep(TIME_BETWEEN_BLOCKS*(START_TIME_OFFSET+END_TIME_OFFSET + 1)) assert len(watcher.appointments) == APPOINTMENTS - 2 # The rest of appointments will timeout after the end (2) + EXPIRY_DELTA