aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/util.py
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2014-12-02 11:44:50 -0500
committerGavin Andresen <gavinandresen@gmail.com>2014-12-02 19:07:39 -0500
commit9e56532959939f417d7603aa2a4a2c1687508897 (patch)
tree01c4e87a2d0f452ee201db473e410c2258a22987 /qa/rpc-tests/util.py
parent90f7aa777865864d5cf7d1f12af8ef37d851faab (diff)
downloadbitcoin-9e56532959939f417d7603aa2a4a2c1687508897.tar.xz
Coinbases-in-mempool regression test
Immature coinbase spends are allowed in the memory pool if they can be mined in the next block. They are not allowed in the memory pool if they cannot be mined in the next block. This regression test tests those edge cases.
Diffstat (limited to 'qa/rpc-tests/util.py')
-rw-r--r--qa/rpc-tests/util.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py
index 6b66bfd8f6..ec65f783e8 100644
--- a/qa/rpc-tests/util.py
+++ b/qa/rpc-tests/util.py
@@ -330,4 +330,14 @@ def assert_equal(thing1, thing2):
def assert_greater_than(thing1, thing2):
if thing1 <= thing2:
- raise AssertionError("%s <= %s"%(str(thing1),str(thing2))) \ No newline at end of file
+ raise AssertionError("%s <= %s"%(str(thing1),str(thing2)))
+
+def assert_raises(exc, fun, *args, **kwds):
+ try:
+ fun(*args, **kwds)
+ except exc:
+ pass
+ except Exception as e:
+ raise AssertionError("Unexpected exception raised: "+type(e).__name__)
+ else:
+ raise AssertionError("No exception raised")