Browse Source

Add more options when asserting in RPC tests

pull/4/head
Eirik Ogilvie-Wigley 6 years ago
parent
commit
a81b36d267
  1. 15
      qa/rpc-tests/test_framework/util.py

15
qa/rpc-tests/test_framework/util.py

@ -355,9 +355,18 @@ def random_transaction(nodes, amount, min_fee, fee_increment, fee_variants):
return (txid, signresult["hex"], fee)
def assert_equal(thing1, thing2):
if thing1 != thing2:
raise AssertionError("%s != %s"%(str(thing1),str(thing2)))
def assert_equal(expected, actual, message = ""):
if expected != actual:
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):
if thing1 <= thing2:

Loading…
Cancel
Save