Fix last unit tests on py34

This commit fixes the last remaining issues in the tempest unit tests.
There were several failures for a couple of different issues previously
but after this running the tempest unit tests will pass on python 3.4.

Change-Id: Icf9090df83f8266a4683c88995c547e3c1bff523
This commit is contained in:
Matthew Treinish 2015-05-10 12:43:58 -04:00
parent 843227d34a
commit 0948724aea
4 changed files with 6 additions and 4 deletions

View File

@ -94,7 +94,7 @@ def _get_api_versions(os, service):
versions = map(lambda x: x['id'], body['versions']['values'])
else:
versions = map(lambda x: x['id'], body['versions'])
return versions
return list(versions)
def verify_keystone_api_versions(os, update):
@ -175,6 +175,7 @@ def verify_extensions(os, service, results):
else:
extensions = map(lambda x: x['alias'], resp)
extensions = list(extensions)
if not results.get(service):
results[service] = {}
extensions_opt = get_enabled_extensions(service)

View File

@ -33,7 +33,7 @@ class StressFrameworkTest(base.TestCase):
cmd = ' '.join([cmd, param])
LOG.info("running: '%s'" % cmd)
cmd_str = cmd
cmd = shlex.split(cmd.encode('utf-8'))
cmd = shlex.split(cmd)
result = ''
result_err = ''
try:

View File

@ -137,7 +137,7 @@ class TestGlanceHTTPClient(base.TestCase):
resp, body = self.client.raw_request('PUT', '/images', body=req_body)
self.assertEqual(200, resp.status)
self.assertEqual('fake_response_body', body.read())
httplib.HTTPConnection.send.assert_call_count(req_body.len)
httplib.HTTPConnection.send.assert_call_count(req_body.tell())
def test_get_connection_class_for_https(self):
conn_class = self.client.get_connection_class('https')

View File

@ -14,6 +14,7 @@
import os
import re
import six
import subprocess
from tempest.tests import base
@ -32,7 +33,7 @@ class TestTestList(base.TestCase):
self.assertEqual(0, p.returncode,
"test discovery failed, one or more files cause an "
"error on import %s" % ids)
ids = ids.split('\n')
ids = six.text_type(ids).split('\n')
for test_id in ids:
if re.match('(\w+\.){3}\w+', test_id):
if not test_id.startswith('tempest.'):