Python 3: fix test_attributes
In Python 3, strings have an __iter__ method, which makes convert_to_list fail. Change-Id: I2411ecd31d7d05ff6f0f004180edffc76d28573b Blueprint: neutron-python3
This commit is contained in:
parent
95f8831344
commit
237fa342f9
|
@ -578,7 +578,7 @@ def convert_none_to_empty_dict(value):
|
|||
def convert_to_list(data):
|
||||
if data is None:
|
||||
return []
|
||||
elif hasattr(data, '__iter__'):
|
||||
elif hasattr(data, '__iter__') and not isinstance(data, six.string_types):
|
||||
return list(data)
|
||||
else:
|
||||
return [data]
|
||||
|
|
1
tox.ini
1
tox.ini
|
@ -174,6 +174,7 @@ commands = python -m testtools.run \
|
|||
neutron.tests.unit.api.rpc.handlers.test_securitygroups_rpc \
|
||||
neutron.tests.unit.api.rpc.handlers.test_dvr_rpc \
|
||||
neutron.tests.unit.api.rpc.agentnotifiers.test_dhcp_rpc_agent_api \
|
||||
neutron.tests.unit.api.v2.test_attributes \
|
||||
neutron.tests.unit.agent.metadata.test_driver \
|
||||
neutron.tests.unit.agent.test_rpc \
|
||||
neutron.tests.unit.agent.test_securitygroups_rpc \
|
||||
|
|
Loading…
Reference in New Issue