Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.

Commit e19b91f

Browse files
karimodmacha-bill
authored andcommitted
Change: Regression tests to python3 (#1707)
* Fix python-regression utilities to support Python3 * Python3 'str' type does not support 'decode()' anymore, everything is utf-8 by default
1 parent ce190ae commit e19b91f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

python-regression/tests/features/steps/api_test_steps.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ def compare_thread_return(step, api_call):
120120
del response_list['duration']
121121
if 'info' in response_list:
122122
del response_list['info']
123-
response_keys = response_list.keys()
123+
response_keys = list(response_list.keys())
124124

125125
expected_values = {}
126126
api_utils.prepare_options(step.hashes,expected_values)
127-
keys = expected_values.keys()
127+
keys = list(expected_values.keys())
128128

129129
# Confirm that the lists are of equal length before comparing
130130
assert len(keys) == len(response_keys), \

python-regression/util/neighbor_logic/neighbor_logic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ def check_if_neighbors(api, neighbors, expected_neighbor):
2626

2727
if is_neighbor is False:
2828
tcp_address = "tcp://" + expected_neighbor
29-
api.add_neighbors([tcp_address.decode()])
29+
api.add_neighbors([tcp_address])
3030
logger.info('{} added as neighbor'.format(tcp_address))

python-regression/util/test_logic/value_fetch_logic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def fetch_node_address(value):
7676
host = world.machine['nodes'][value]['host']
7777
port = world.machine['nodes'][value]['ports']['gossip-tcp']
7878
address = "tcp://" + host + ":" + str(port)
79-
return [address.decode()]
79+
return [address]
8080

8181

8282
def fetch_static_value(value):

0 commit comments

Comments
 (0)