- use six.text_type instead of unicode for assertion;
- use dict.items() instead of dict.iteritems() for dict iteration;
- use six.text_type to capture exception messages, the 'message' attribute
is no longer existing;
- dict.keys() returns a dict_keys object under Python3 which cannot be
reversed, explicitly convert it to a list.
Reviewed: https:/ /review. openstack. org/554681 /git.openstack. org/cgit/ openstack/ trove-dashboard /commit/ ?id=c51b3bbe830 f1a22d40613bec2 046e8c75dbf67e
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit c51b3bbe830f1a2 2d40613bec2046e 8c75dbf67e
Author: Zhao Chao <email address hidden>
Date: Thu Mar 15 10:10:19 2018 +0800
Fix str and dict usages in unittests for Python3
- use six.text_type instead of unicode for assertion;
- use dict.items() instead of dict.iteritems() for dict iteration;
- use six.text_type to capture exception messages, the 'message' attribute
is no longer existing;
- dict.keys() returns a dict_keys object under Python3 which cannot be
reversed, explicitly convert it to a list.
Partial-Bug: #1755413
Change-Id: I5d31397b7bfe08 b504ee5b9cd4ff8 94031f66c2b ed38eb355fe4447 690a10ed66)
Signed-off-by: Zhao Chao <email address hidden>
(cherry picked from commit 996e134a1c3b903