import json
import logging
-import urllib
from functools import wraps
import requests
+from six.moves import urllib
from functest.utils.constants import CONST
import functest.utils.functest_utils as ft_utils
assert environment
uri_comp = "/recorders/environment/"
- uri_comp += urllib.quote_plus(environment)
+ uri_comp += urllib.parse.quote_plus(environment)
# Creds
creds_usr = ft_utils.get_functest_config(
except Exception as exc: # pylint: disable=broad-except
EnergyRecorder.logger.info(
"Energy recorder API is not available, cause=%s",
- exc.message)
+ str(exc))
api_available = False
# Final config
EnergyRecorder.energy_recorder_api = {
with self.assertRaises(Exception) as context:
self.__decorated_method_with_ex()
self.assertTrue(
- self.exception_message_to_preserve in context.exception
+ self.exception_message_to_preserve in str(context.exception)
)
self.assertTrue(finish_mock.called)
modules =
functest.api
functest.core
+ functest.energy
functest.opnfv_tests.sdn.odl
functest.tests.unit.core
+ functest.tests.unit.energy
functest.tests.unit.odl
functest.tests.unit.utils.test_decorators
functest.utils.decorators
dirs =
functest/tests/unit/ci
functest/tests/unit/core
+ functest/tests/unit/energy
functest/tests/unit/odl
functest/tests/unit/utils
commands = nosetests {[testenv:py35]dirs}