Replaces map() with six.moves.map() to provide py2/3 compatibility

Partially-Implements: blueprint designate-py3

Change-Id: I0f2a62bf47f06f1dfbb9a89517c7552c5ad331e3
This commit is contained in:
sonu.kumar
2015-11-25 10:22:52 +05:30
parent bb9de39180
commit 870d8ce15a
3 changed files with 9 additions and 3 deletions
@@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
from tempest.api.dns import base
from tempest.common.utils import data_utils
from tempest import exceptions
@@ -51,7 +52,8 @@ class ServersAdminTestJSON(base.BaseDnsAdminTest):
_, servers = self.client.list_servers()
# Verify servers created in setup class are in the list
for server in self.setup_servers:
self.assertIn(server['id'], map(lambda x: x['id'], servers))
self.assertIn(server['id'],
six.moves.map(lambda x: x['id'], servers))
@test.attr(type='smoke')
def test_create_update_get_delete_server(self):
+3 -1
View File
@@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
from tempest.api.dns import base
from tempest.common.utils import data_utils
from tempest import exceptions
@@ -50,7 +51,8 @@ class DnsDomainsTest(base.BaseDnsTest):
_, domains = self.client.list_domains()
# Verify domains created in setup class are in the list
for domain in self.setup_domains:
self.assertIn(domain['id'], map(lambda x: x['id'], domains))
self.assertIn(domain['id'],
six.moves.map(lambda x: x['id'], domains))
@test.attr(type='smoke')
def test_create_update_get_domain(self):
+3 -1
View File
@@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
from tempest.api.dns import base
from tempest.common.utils import data_utils
from tempest import exceptions
@@ -62,7 +63,8 @@ class RecordsTest(base.BaseDnsTest):
_, records = self.client.list_records(self.domain['id'])
# Verify records created in setup class are in the list
for record in self.setup_records:
self.assertIn(record['id'], map(lambda x: x['id'], records))
self.assertIn(record['id'],
six.moves.map(lambda x: x['id'], records))
@test.attr(type='smoke')
def test_create_update_get_delete_record(self):