Replace six.iteritems() with .items()

1.As mentioned in [1], we should avoid using
six.iteritems to achieve iterators. We can use
dict.items instead, as it will return iterators
in PY3 as well. And dict.items/keys will more
readable. 2.In py2, the performance about list
should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I7844f6425787388fa37b85b3c0f305b34cddc0fa
This commit is contained in:
gecong1973 2016-11-28 10:19:14 +08:00
parent 3146c32738
commit 20e93c4686
1 changed files with 1 additions and 2 deletions

View File

@ -13,7 +13,6 @@
# under the License.
import datetime
import six
import mock
@ -60,7 +59,7 @@ class TestModelTestMethods(base.BaseIntegrationTest):
.first()
def check_model_obj_attrs(self, obj, attrs):
for attr_name, attr_val in six.iteritems(attrs):
for attr_name, attr_val in attrs.items():
self.assertEqual(attr_val, getattr(obj, attr_name))
def test_add_result(self):