test: create assert_not_equal util and add to where imports are needed

In the functional tests there are lots of cases where we assert != which
this new util will replace, we also are adding the imports and the new assertion
This commit is contained in:
kevkevin authored and kevkevinpal committed 2025-04-01 08:39:24 -04:00
1 parent 930b237f16
commit 7bb83f6718
41 files changed
+137 -83

No files matched your search

+2 -1
View File
@@ -9,6 +9,7 @@ import itertools
import time
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_not_equal
from test_framework.messages import (
NODE_NETWORK,
NODE_NETWORK_LIMITED,
@@ -55,7 +56,7 @@ class P2PHandshakeTest(BitcoinTestFramework):
expected_result = "disconnect" if expect_disconnect else "connect"
self.log.info(f' - services 0x{services:08x}, type "{conn_type}" [{expected_result}]')
if expect_disconnect:
assert (services & desirable_service_flags) != desirable_service_flags
assert_not_equal((services & desirable_service_flags), desirable_service_flags)
expected_debug_log = f'does not offer the expected services ' \
f'({services:08x} offered, {desirable_service_flags:08x} expected)'
with node.assert_debug_log([expected_debug_log]):