Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_node.py
Show First 20 Lines • Show All 349 Lines • ▼ Show 20 Lines | def is_node_stopped(self): | ||||
self.log.debug("Node stopped") | self.log.debug("Node stopped") | ||||
return True | return True | ||||
def wait_until_stopped(self, timeout=BITCOIND_PROC_WAIT_TIMEOUT): | def wait_until_stopped(self, timeout=BITCOIND_PROC_WAIT_TIMEOUT): | ||||
wait_until(self.is_node_stopped, timeout=timeout) | wait_until(self.is_node_stopped, timeout=timeout) | ||||
@contextlib.contextmanager | @contextlib.contextmanager | ||||
def assert_debug_log(self, expected_msgs, unexpected_msgs=None, timeout=2): | def assert_debug_log(self, expected_msgs, unexpected_msgs=None, timeout=2): | ||||
if not expected_msgs: | |||||
raise AssertionError("Expected debug messages is empty") | |||||
if unexpected_msgs is None: | if unexpected_msgs is None: | ||||
unexpected_msgs = [] | unexpected_msgs = [] | ||||
time_end = time.time() + timeout | time_end = time.time() + timeout | ||||
debug_log = os.path.join(self.datadir, self.chain, 'debug.log') | debug_log = os.path.join(self.datadir, self.chain, 'debug.log') | ||||
with open(debug_log, encoding='utf-8') as dl: | with open(debug_log, encoding='utf-8') as dl: | ||||
dl.seek(0, 2) | dl.seek(0, 2) | ||||
prev_size = dl.tell() | prev_size = dl.tell() | ||||
▲ Show 20 Lines • Show All 213 Lines • Show Last 20 Lines |