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

Commit

Permalink
Change: Regression tests to python3 (#1707)
Browse files Browse the repository at this point in the history
* Fix python-regression utilities to support Python3

* Python3 'str' type does not support 'decode()' anymore, everything is utf-8 by default
  • Loading branch information
karimodm authored and acha-bill committed Mar 11, 2020
1 parent ce190ae commit e19b91f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python-regression/tests/features/steps/api_test_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ def compare_thread_return(step, api_call):
del response_list['duration']
if 'info' in response_list:
del response_list['info']
response_keys = response_list.keys()
response_keys = list(response_list.keys())

expected_values = {}
api_utils.prepare_options(step.hashes,expected_values)
keys = expected_values.keys()
keys = list(expected_values.keys())

# Confirm that the lists are of equal length before comparing
assert len(keys) == len(response_keys), \
Expand Down
2 changes: 1 addition & 1 deletion python-regression/util/neighbor_logic/neighbor_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ def check_if_neighbors(api, neighbors, expected_neighbor):

if is_neighbor is False:
tcp_address = "tcp://" + expected_neighbor
api.add_neighbors([tcp_address.decode()])
api.add_neighbors([tcp_address])
logger.info('{} added as neighbor'.format(tcp_address))
2 changes: 1 addition & 1 deletion python-regression/util/test_logic/value_fetch_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def fetch_node_address(value):
host = world.machine['nodes'][value]['host']
port = world.machine['nodes'][value]['ports']['gossip-tcp']
address = "tcp://" + host + ":" + str(port)
return [address.decode()]
return [address]


def fetch_static_value(value):
Expand Down

0 comments on commit e19b91f

Please sign in to comment.