MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / assert_equal

Function assert_equal

test/functional/test_framework/util.py:86–94  ·  view source on GitHub ↗
(thing1, thing2, *args)

Source from the content-addressed store, hash-verified

84 return d1, d2
85
86def assert_equal(thing1, thing2, *args):
87 if thing1 != thing2 and not args and isinstance(thing1, dict) and isinstance(thing2, dict):
88 d1,d2 = summarise_dict_differences(thing1, thing2)
89 if d1 != thing1 or d2 != thing2:
90 raise AssertionError(f"not({thing1!s} == {thing2!s})\n in particular not({d1!s} == {d2!s})")
91 else:
92 raise AssertionError(f"not({thing1!s} == {thing2!s})")
93 if thing1 != thing2 or any(thing1 != arg for arg in args):
94 raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
95
96def assert_not_equal(thing1, thing2, *, error_message=""):
97 if thing1 == thing2:

Callers 15

test_null_locatorsMethod · 0.90
test_nonnull_locatorsMethod · 0.90
run_testMethod · 0.90
run_testMethod · 0.90
check_dump_outputMethod · 0.90
check_tx_countsMethod · 0.90
assert_net_servicesnamesFunction · 0.90
seed_addrmanFunction · 0.90

Calls 2

joinMethod · 0.80

Tested by 15

test_null_locatorsMethod · 0.72
test_nonnull_locatorsMethod · 0.72
test_connection_countMethod · 0.72
test_getpeerinfoMethod · 0.72
test_getnetworkinfoMethod · 0.72
test_service_flagsMethod · 0.72
test_getnodeaddressesMethod · 0.72
test_addpeeraddressMethod · 0.72
test_getaddrmaninfoMethod · 0.72