mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 09:24:47 +00:00
functional_tests: fix rpc_payment tests with python 3
This commit is contained in:
parent
7caa2b0d3e
commit
978a61f34f
1 changed files with 4 additions and 3 deletions
|
@ -51,13 +51,13 @@ class RPCPaymentTest():
|
||||||
self.test_free_access()
|
self.test_free_access()
|
||||||
|
|
||||||
def get_keys(self):
|
def get_keys(self):
|
||||||
output = subprocess.check_output([self.make_test_signature]).rstrip()
|
output = subprocess.check_output([self.make_test_signature]).decode('utf-8').rstrip()
|
||||||
fields = output.split()
|
fields = output.split()
|
||||||
assert len(fields) == 2
|
assert len(fields) == 2
|
||||||
return fields
|
return fields
|
||||||
|
|
||||||
def get_signature(self):
|
def get_signature(self):
|
||||||
return subprocess.check_output([self.make_test_signature, self.secret_key]).rstrip()
|
return subprocess.check_output([self.make_test_signature, self.secret_key]).decode('utf-8').rstrip()
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
print('Resetting blockchain')
|
print('Resetting blockchain')
|
||||||
|
@ -256,7 +256,8 @@ class RPCPaymentTest():
|
||||||
found_close_stale += 1
|
found_close_stale += 1
|
||||||
found_valid += 1
|
found_valid += 1
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if e[0]['error']['code'] == -18: # stale
|
#if e[0]['error']['code'] == -18: # stale
|
||||||
|
if "'code': -18" in str(e): # stale (ugly version, but also works with python 3)
|
||||||
found_late_stale += 1
|
found_late_stale += 1
|
||||||
else:
|
else:
|
||||||
found_invalid += 1
|
found_invalid += 1
|
||||||
|
|
Loading…
Reference in a new issue