Corrects the type of a base64 encoded string

The nova/tests/functional/api_sample_tests/test_servers.py contains the
ServersSampleBase class, and in its class definition creates a
'user_data' attribute by base64 encoding a string. However, this will
not work in Python 3, as the base64.b64encode() method requires bytes,
not a string. As a result, importing the test class fails and no tests
get run.

Note that this change doesn't fix all tests to work under Python 3; it
simply fixes the bug that prevents the tests from running at all under
Python 3.

Closes-Bug: #1632856

Change-Id: I35a7b02132bed0387a173b339f6204bf0e3269de
This commit is contained in:
EdLeafe 2016-10-12 20:55:40 +00:00
parent 6c8ba55e3c
commit 3b8826b996

View File

@ -47,8 +47,8 @@ commands =
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
[testenv:functional]
# TODO(melwitt): This can be removed when functional tests can be run
# with python 3.x
# TODO(melwitt): This can be removed when functional tests are gating with
# python 3.x
basepython = python2.7
usedevelop = True
setenv = VIRTUAL_ENV={envdir}