Merge "Using six.iteritems() to avoid some python3 tests failure"

This commit is contained in:
Jenkins 2015-09-25 08:17:35 +00:00 committed by Gerrit Code Review
commit 1d23e72a12
2 changed files with 7 additions and 4 deletions

View File

@ -23,6 +23,7 @@ import mock
from oslo_config import cfg
from oslo_log import log as logging
from oslotest import base
import six
import testtools.matchers as ttm
from mistral import context as auth_context
@ -116,7 +117,7 @@ class BaseTest(base.BaseTestCase):
def _assert_multiple_items(self, items, count, **props):
def _matches(item, **props):
for prop_name, prop_val in props.iteritems():
for prop_name, prop_val in six.iteritems(props):
v = item[prop_name] if isinstance(
item, dict) else getattr(item, prop_name)
@ -149,7 +150,7 @@ class BaseTest(base.BaseTestCase):
missing = []
mismatched = []
for key, value in expected.iteritems():
for key, value in six.iteritems(expected):
if key not in actual:
missing.append(key)
elif value != actual[key]:

View File

@ -13,10 +13,12 @@
# under the License.
import json
import mock
import os
import time
import mock
import six
from tempest import clients
from tempest import config
from tempest import test as test
@ -37,7 +39,7 @@ def get_resource(path):
def find_items(items, **props):
def _matches(item, **props):
for prop_name, prop_val in props.iteritems():
for prop_name, prop_val in six.iteritems(props):
if item[prop_name] != prop_val:
return False