aboutsummaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2016-04-23 14:35:52 +0200
committerMarcoFalke <falke.marco@gmail.com>2016-06-10 00:22:41 +0200
commit493b89e959f58939fd683cb0a6f1a58287543308 (patch)
tree5ac1f30fca79ff471a745e90ca9083a7440e4654 /qa
parent7a8348994bb7b86a0445f8e333b3b1dc27252753 (diff)
downloadbitcoin-493b89e959f58939fd683cb0a6f1a58287543308.tar.xz
[qa] test_framework: Properly print exceptions and assert empty dict
Github-Pull: #7951 Rebased-From: 5555528b47b7d33a5b963c076e6bb09ee25931b5 fada064f67302502f6b51d9d22927381c2707cbb
Diffstat (limited to 'qa')
-rwxr-xr-xqa/rpc-tests/test_framework/mininode.py8
-rwxr-xr-xqa/rpc-tests/test_framework/test_framework.py2
-rw-r--r--qa/rpc-tests/test_framework/util.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py
index ece5a15589..1dd1f707ee 100755
--- a/qa/rpc-tests/test_framework/mininode.py
+++ b/qa/rpc-tests/test_framework/mininode.py
@@ -93,7 +93,7 @@ def deser_uint256(f):
def ser_uint256(u):
- rs = ""
+ rs = b""
for i in xrange(8):
rs += struct.pack("<I", u & 0xFFFFFFFFL)
u >>= 32
@@ -191,7 +191,7 @@ def deser_string_vector(f):
def ser_string_vector(l):
- r = ""
+ r = b""
if len(l) < 253:
r = struct.pack("B", len(l))
elif len(l) < 0x10000:
@@ -624,7 +624,7 @@ class CAlert(object):
self.vchSig = deser_string(f)
def serialize(self):
- r = ""
+ r = b""
r += ser_string(self.vchMsg)
r += ser_string(self.vchSig)
return r
@@ -988,7 +988,7 @@ class msg_reject(object):
def __init__(self):
self.message = b""
self.code = 0
- self.reason = ""
+ self.reason = b""
self.data = 0L
def deserialize(self, f):
diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py
index 19ee472609..0ac7b8a27e 100755
--- a/qa/rpc-tests/test_framework/test_framework.py
+++ b/qa/rpc-tests/test_framework/test_framework.py
@@ -143,7 +143,7 @@ class BitcoinTestFramework(object):
print("Assertion failed: "+ str(e))
traceback.print_tb(sys.exc_info()[2])
except Exception as e:
- print("Unexpected exception caught during testing: "+str(e))
+ print("Unexpected exception caught during testing: " + repr(e))
traceback.print_tb(sys.exc_info()[2])
if not self.options.noshutdown:
diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py
index 875b6cf72a..9bfc422314 100644
--- a/qa/rpc-tests/test_framework/util.py
+++ b/qa/rpc-tests/test_framework/util.py
@@ -488,7 +488,7 @@ def assert_array_result(object_array, to_match, expected, should_not_find = Fals
in object_array
"""
if should_not_find == True:
- expected = { }
+ assert_equal(expected, { })
num_matched = 0
for item in object_array:
all_match = True