Adds py3 to tox environment
Adds py3 and removes py27 from tox environment Fixes testcases that were failing for py38 environment. Depends-on: https://review.opendev.org/#/c/738168/ Change-Id: I1a5f88c06808449e906d9b8ad43d690136737800
This commit is contained in:
parent
64540ba316
commit
a6d02fb6c2
|
@ -1,5 +1,4 @@
|
||||||
- project:
|
- project:
|
||||||
templates:
|
templates:
|
||||||
- openstack-python-jobs
|
- openstack-python3-victoria-jobs
|
||||||
- openstack-python36-jobs
|
- openstack-cover-jobs
|
||||||
- openstack-python37-jobs
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import json
|
||||||
import re
|
import re
|
||||||
import unittest
|
import unittest
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
import xmltodict
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
import mock
|
||||||
|
@ -102,6 +103,7 @@ class IloRibclTestCase(unittest.TestCase):
|
||||||
self.ilo = ribcl.RIBCLOperations("x.x.x.x", "admin",
|
self.ilo = ribcl.RIBCLOperations("x.x.x.x", "admin",
|
||||||
"Admin", 60, 443)
|
"Admin", 60, 443)
|
||||||
self.ilo.init_model_based_tags('ProLiant DL580 Gen8')
|
self.ilo.init_model_based_tags('ProLiant DL580 Gen8')
|
||||||
|
self.maxDiff = None
|
||||||
|
|
||||||
def test_init_model_based_tags_gen7(self):
|
def test_init_model_based_tags_gen7(self):
|
||||||
self.ilo.init_model_based_tags('Proliant DL380 G7')
|
self.ilo.init_model_based_tags('Proliant DL380 G7')
|
||||||
|
@ -828,15 +830,19 @@ class IloRibclTestCase(unittest.TestCase):
|
||||||
upload_file_to_mock.assert_called_once_with(
|
upload_file_to_mock.assert_called_once_with(
|
||||||
(self.ilo.host, self.ilo.port), self.ilo.timeout)
|
(self.ilo.host, self.ilo.port), self.ilo.timeout)
|
||||||
|
|
||||||
root_xml_string = constants.UPDATE_ILO_FIRMWARE_INPUT_XML % (
|
ref_root_xml_string = constants.UPDATE_ILO_FIRMWARE_INPUT_XML % (
|
||||||
self.ilo.password, self.ilo.login, 12345, 'raw_fw_file.bin')
|
self.ilo.password, self.ilo.login, 12345, 'raw_fw_file.bin')
|
||||||
root_xml_string = re.sub(r"\n\s*", '', root_xml_string)
|
ref_root_xml_string = re.sub(r"\n\s*", '', ref_root_xml_string)
|
||||||
|
ref_dict = xmltodict.parse(ref_root_xml_string)
|
||||||
|
ref_string = json.dumps(ref_dict, sort_keys=True)
|
||||||
|
|
||||||
((ribcl_obj, xml_elem), the_ext_header_dict) = (
|
((ribcl_obj, xml_elem), the_ext_header_dict) = (
|
||||||
_request_ilo_mock.call_args)
|
_request_ilo_mock.call_args)
|
||||||
|
|
||||||
self.assertEqual(root_xml_string,
|
actual_dict = xmltodict.parse(ET.tostring(xml_elem).decode('latin-1'))
|
||||||
ET.tostring(xml_elem).decode('latin-1'))
|
actual_string = json.dumps(actual_dict, sort_keys=True)
|
||||||
|
self.assertEqual(ref_string, actual_string)
|
||||||
|
|
||||||
self.assertDictEqual(the_ext_header_dict['extra_headers'],
|
self.assertDictEqual(the_ext_header_dict['extra_headers'],
|
||||||
{'Cookie': 'hickory-dickory-dock'})
|
{'Cookie': 'hickory-dickory-dock'})
|
||||||
|
|
||||||
|
@ -862,15 +868,19 @@ class IloRibclTestCase(unittest.TestCase):
|
||||||
upload_file_to_mock.assert_called_once_with(
|
upload_file_to_mock.assert_called_once_with(
|
||||||
(self.ilo.host, self.ilo.port), self.ilo.timeout)
|
(self.ilo.host, self.ilo.port), self.ilo.timeout)
|
||||||
|
|
||||||
root_xml_string = constants.UPDATE_NONILO_FIRMWARE_INPUT_XML % (
|
ref_root_xml_string = constants.UPDATE_NONILO_FIRMWARE_INPUT_XML % (
|
||||||
self.ilo.password, self.ilo.login, 12345, 'raw_fw_file.bin')
|
self.ilo.password, self.ilo.login, 12345, 'raw_fw_file.bin')
|
||||||
root_xml_string = re.sub(r"\n\s*", '', root_xml_string)
|
ref_root_xml_string = re.sub(r"\n\s*", '', ref_root_xml_string)
|
||||||
|
ref_dict = xmltodict.parse(ref_root_xml_string)
|
||||||
|
ref_string = json.dumps(ref_dict, sort_keys=True)
|
||||||
|
|
||||||
((ribcl_obj, xml_elem), the_ext_header_dict) = (
|
((ribcl_obj, xml_elem), the_ext_header_dict) = (
|
||||||
_request_ilo_mock.call_args)
|
_request_ilo_mock.call_args)
|
||||||
|
|
||||||
self.assertEqual(root_xml_string,
|
actual_dict = xmltodict.parse(ET.tostring(xml_elem).decode('latin-1'))
|
||||||
ET.tostring(xml_elem).decode('latin-1'))
|
actual_string = json.dumps(actual_dict, sort_keys=True)
|
||||||
|
self.assertEqual(ref_string, actual_string)
|
||||||
|
|
||||||
self.assertDictEqual(the_ext_header_dict['extra_headers'],
|
self.assertDictEqual(the_ext_header_dict['extra_headers'],
|
||||||
{'Cookie': 'hickory-dickory-dock'})
|
{'Cookie': 'hickory-dickory-dock'})
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,8 @@ description-file =
|
||||||
license = Apache License, Version 2.0
|
license = Apache License, Version 2.0
|
||||||
author = Hewlett Packard Enterprise
|
author = Hewlett Packard Enterprise
|
||||||
author-email = proliantutils@gmail.com
|
author-email = proliantutils@gmail.com
|
||||||
home-page = https://github.com/openstack/proliantutils
|
home-page = https://opendev.org/x/proliantutils
|
||||||
|
python-requires = >=3.6
|
||||||
classifier =
|
classifier =
|
||||||
Development Status :: 4 - Beta
|
Development Status :: 4 - Beta
|
||||||
Environment :: Console
|
Environment :: Console
|
||||||
|
@ -16,12 +17,11 @@ classifier =
|
||||||
License :: OSI Approved :: Apache Software License
|
License :: OSI Approved :: Apache Software License
|
||||||
Operating System :: OS Independent
|
Operating System :: OS Independent
|
||||||
Programming Language :: Python
|
Programming Language :: Python
|
||||||
Programming Language :: Python :: 2
|
|
||||||
Programming Language :: Python :: 2.7
|
|
||||||
Programming Language :: Python :: 3
|
Programming Language :: Python :: 3
|
||||||
Programming Language :: Python :: 3.5
|
Programming Language :: Python :: 3 :: Only
|
||||||
Programming Language :: Python :: 3.6
|
Programming Language :: Python :: 3.6
|
||||||
Programming Language :: Python :: 3.7
|
Programming Language :: Python :: 3.7
|
||||||
|
Programming Language :: Python :: 3.8
|
||||||
|
|
||||||
[files]
|
[files]
|
||||||
packages =
|
packages =
|
||||||
|
|
|
@ -3,3 +3,4 @@ coverage>=3.6 # Apache-2.0
|
||||||
stestr!=2.3.0 # Apache-2.0
|
stestr!=2.3.0 # Apache-2.0
|
||||||
testtools>=1.4.0 # MIT
|
testtools>=1.4.0 # MIT
|
||||||
ddt
|
ddt
|
||||||
|
xmltodict
|
||||||
|
|
17
tox.ini
17
tox.ini
|
@ -1,18 +1,25 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py35,py34,py27,pep8
|
minversion = 3.1.0
|
||||||
|
skipsdist = True
|
||||||
|
envlist = py3,pep8
|
||||||
|
ignore_basepython_conflict=true
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
install_command = pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
|
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
PYTHONDONTWRITEBYTECODE = 1
|
PYTHONDONTWRITEBYTECODE = 1
|
||||||
|
LANGUAGE=en_US
|
||||||
LC_ALL=en_US.UTF-8
|
LC_ALL=en_US.UTF-8
|
||||||
|
PYTHONWARNINGS=default::DeprecationWarning
|
||||||
TESTS_DIR=./proliantutils/tests/
|
TESTS_DIR=./proliantutils/tests/
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/requirements.txt
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
commands = stestr run {posargs}
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
commands =
|
||||||
|
stestr run {posargs}
|
||||||
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
deps =
|
deps =
|
||||||
|
|
Loading…
Reference in New Issue