Add more options when asserting in RPC tests
This commit is contained in:
parent
d97bfb766b
commit
a81b36d267
|
@ -355,9 +355,18 @@ def random_transaction(nodes, amount, min_fee, fee_increment, fee_variants):
|
||||||
|
|
||||||
return (txid, signresult["hex"], fee)
|
return (txid, signresult["hex"], fee)
|
||||||
|
|
||||||
def assert_equal(thing1, thing2):
|
def assert_equal(expected, actual, message = ""):
|
||||||
if thing1 != thing2:
|
if expected != actual:
|
||||||
raise AssertionError("%s != %s"%(str(thing1),str(thing2)))
|
if message:
|
||||||
|
message = "%s; " % message
|
||||||
|
raise AssertionError("%sexpected: <%s> but was: <%s>" % (message, str(expected), str(actual)))
|
||||||
|
|
||||||
|
def assert_true(condition, message = ""):
|
||||||
|
if not condition:
|
||||||
|
raise AssertionError(message)
|
||||||
|
|
||||||
|
def assert_false(condition, message = ""):
|
||||||
|
assert_true(not condition, message)
|
||||||
|
|
||||||
def assert_greater_than(thing1, thing2):
|
def assert_greater_than(thing1, thing2):
|
||||||
if thing1 <= thing2:
|
if thing1 <= thing2:
|
||||||
|
|
Loading…
Reference in New Issue