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:
parent
843227d34a
commit
0948724aea
|
@ -94,7 +94,7 @@ def _get_api_versions(os, service):
|
||||||
versions = map(lambda x: x['id'], body['versions']['values'])
|
versions = map(lambda x: x['id'], body['versions']['values'])
|
||||||
else:
|
else:
|
||||||
versions = map(lambda x: x['id'], body['versions'])
|
versions = map(lambda x: x['id'], body['versions'])
|
||||||
return versions
|
return list(versions)
|
||||||
|
|
||||||
|
|
||||||
def verify_keystone_api_versions(os, update):
|
def verify_keystone_api_versions(os, update):
|
||||||
|
@ -175,6 +175,7 @@ def verify_extensions(os, service, results):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
extensions = map(lambda x: x['alias'], resp)
|
extensions = map(lambda x: x['alias'], resp)
|
||||||
|
extensions = list(extensions)
|
||||||
if not results.get(service):
|
if not results.get(service):
|
||||||
results[service] = {}
|
results[service] = {}
|
||||||
extensions_opt = get_enabled_extensions(service)
|
extensions_opt = get_enabled_extensions(service)
|
||||||
|
|
|
@ -33,7 +33,7 @@ class StressFrameworkTest(base.TestCase):
|
||||||
cmd = ' '.join([cmd, param])
|
cmd = ' '.join([cmd, param])
|
||||||
LOG.info("running: '%s'" % cmd)
|
LOG.info("running: '%s'" % cmd)
|
||||||
cmd_str = cmd
|
cmd_str = cmd
|
||||||
cmd = shlex.split(cmd.encode('utf-8'))
|
cmd = shlex.split(cmd)
|
||||||
result = ''
|
result = ''
|
||||||
result_err = ''
|
result_err = ''
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -137,7 +137,7 @@ class TestGlanceHTTPClient(base.TestCase):
|
||||||
resp, body = self.client.raw_request('PUT', '/images', body=req_body)
|
resp, body = self.client.raw_request('PUT', '/images', body=req_body)
|
||||||
self.assertEqual(200, resp.status)
|
self.assertEqual(200, resp.status)
|
||||||
self.assertEqual('fake_response_body', body.read())
|
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):
|
def test_get_connection_class_for_https(self):
|
||||||
conn_class = self.client.get_connection_class('https')
|
conn_class = self.client.get_connection_class('https')
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import six
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from tempest.tests import base
|
from tempest.tests import base
|
||||||
|
@ -32,7 +33,7 @@ class TestTestList(base.TestCase):
|
||||||
self.assertEqual(0, p.returncode,
|
self.assertEqual(0, p.returncode,
|
||||||
"test discovery failed, one or more files cause an "
|
"test discovery failed, one or more files cause an "
|
||||||
"error on import %s" % ids)
|
"error on import %s" % ids)
|
||||||
ids = ids.split('\n')
|
ids = six.text_type(ids).split('\n')
|
||||||
for test_id in ids:
|
for test_id in ids:
|
||||||
if re.match('(\w+\.){3}\w+', test_id):
|
if re.match('(\w+\.){3}\w+', test_id):
|
||||||
if not test_id.startswith('tempest.'):
|
if not test_id.startswith('tempest.'):
|
||||||
|
|
Loading…
Reference in New Issue