Skip to content

Commit 5c7df70

Browse files
author
MarcoFalke
committed
Merge #7951: [qa] test_framework: Properly print exception
fada064 [qa] test_framework: Properly print exceptions and assert empty dict (MarcoFalke) 5555528 [qa] mininode: Unfiddle strings into bytes (MarcoFalke)
2 parents e26b620 + fada064 commit 5c7df70

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

qa/rpc-tests/test_framework/mininode.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def deser_uint256(f):
9393

9494

9595
def ser_uint256(u):
96-
rs = ""
96+
rs = b""
9797
for i in xrange(8):
9898
rs += struct.pack("<I", u & 0xFFFFFFFFL)
9999
u >>= 32
@@ -191,7 +191,7 @@ def deser_string_vector(f):
191191

192192

193193
def ser_string_vector(l):
194-
r = ""
194+
r = b""
195195
if len(l) < 253:
196196
r = struct.pack("B", len(l))
197197
elif len(l) < 0x10000:
@@ -624,7 +624,7 @@ def deserialize(self, f):
624624
self.vchSig = deser_string(f)
625625

626626
def serialize(self):
627-
r = ""
627+
r = b""
628628
r += ser_string(self.vchMsg)
629629
r += ser_string(self.vchSig)
630630
return r
@@ -988,7 +988,7 @@ class msg_reject(object):
988988
def __init__(self):
989989
self.message = b""
990990
self.code = 0
991-
self.reason = ""
991+
self.reason = b""
992992
self.data = 0L
993993

994994
def deserialize(self, f):

qa/rpc-tests/test_framework/test_framework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def main(self):
146146
print("key not found: "+ str(e))
147147
traceback.print_tb(sys.exc_info()[2])
148148
except Exception as e:
149-
print("Unexpected exception caught during testing: "+str(e))
149+
print("Unexpected exception caught during testing: " + repr(e))
150150
traceback.print_tb(sys.exc_info()[2])
151151

152152
if not self.options.noshutdown:

qa/rpc-tests/test_framework/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def assert_array_result(object_array, to_match, expected, should_not_find = Fals
487487
in object_array
488488
"""
489489
if should_not_find == True:
490-
expected = { }
490+
assert_equal(expected, { })
491491
num_matched = 0
492492
for item in object_array:
493493
all_match = True

0 commit comments

Comments
 (0)