Fixes for tox4
- use generic test template - remove autospec in power test as we don't use actual libvirt module to test. The libvirt-python module is fully mocked. Change-Id: Ied36a8afb818422c643edca8a2feeec977b53551
This commit is contained in:
parent
2976bed022
commit
6a2590ec6a
@ -24,7 +24,7 @@
|
||||
vars:
|
||||
rtd_webhook_id: '44747'
|
||||
templates:
|
||||
- openstack-python3-zed-jobs
|
||||
- openstack-python3-jobs
|
||||
- docs-on-readthedocs
|
||||
- check-requirements
|
||||
check:
|
||||
|
@ -167,22 +167,22 @@ class LibvirtValidateParametersTestCase(BaseLibvirtTest):
|
||||
|
||||
class LibvirtPrivateMethodsTestCase(BaseLibvirtTest):
|
||||
|
||||
@mock.patch.object(power.libvirt, 'openAuth', autospec=True)
|
||||
def test__get_libvirt_connection_sasl_auth(self, libvirt_open_mock):
|
||||
@mock.patch.object(power.libvirt, 'openAuth')
|
||||
def test__get_libvirt_connection_sasl_auth(self, libvirt_openauth_mock):
|
||||
node = obj_utils.get_test_node(
|
||||
self.context,
|
||||
driver='staging-libvirt',
|
||||
driver_info=_get_test_libvirt_driver_info('sasl'))
|
||||
power._get_libvirt_connection(node['driver_info'])
|
||||
|
||||
libvirt_open_mock.assert_called_once_with(
|
||||
libvirt_openauth_mock.assert_called_once_with(
|
||||
'test+tcp://localhost:5000/test',
|
||||
[[power.libvirt.VIR_CRED_AUTHNAME,
|
||||
power.libvirt.VIR_CRED_PASSPHRASE],
|
||||
mock.ANY, # Inline cred function
|
||||
None], 0)
|
||||
|
||||
@mock.patch.object(power.libvirt, 'open', autospec=True)
|
||||
@mock.patch.object(power.libvirt, 'open')
|
||||
def test__get_libvirt_connection_ssh(self, libvirt_open_mock):
|
||||
node = obj_utils.get_test_node(
|
||||
self.context,
|
||||
@ -193,7 +193,7 @@ class LibvirtPrivateMethodsTestCase(BaseLibvirtTest):
|
||||
libvirt_open_mock.assert_called_once_with(
|
||||
'qemu+ssh://test@test/?keyfile=/test/key/file&no_verify=1')
|
||||
|
||||
@mock.patch.object(power.libvirt, 'open', autospec=True)
|
||||
@mock.patch.object(power.libvirt, 'open')
|
||||
def test__get_libvirt_connection_socket(self, libvirt_open_mock):
|
||||
node = obj_utils.get_test_node(
|
||||
self.context,
|
||||
|
@ -7,3 +7,4 @@ coverage!=4.4,>=4.0 # Apache-2.0
|
||||
oslotest>=3.2.0 # Apache-2.0
|
||||
testtools>=2.2.0 # MIT
|
||||
stestr>=2.0.0 # Apache-2.0
|
||||
|
||||
|
8
tox.ini
8
tox.ini
@ -1,6 +1,5 @@
|
||||
[tox]
|
||||
minversion = 3.18.0
|
||||
skipsdist = True
|
||||
envlist = py3,pep8
|
||||
ignore_basepython_conflict=true
|
||||
|
||||
@ -18,7 +17,12 @@ deps =
|
||||
-r{toxinidir}/extra-requirements.txt
|
||||
commands =
|
||||
stestr run {posargs}
|
||||
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
||||
passenv = http_proxy
|
||||
HTTP_PROXY
|
||||
https_proxy
|
||||
HTTPS_PROXY
|
||||
no_proxy
|
||||
NO_PROXY
|
||||
|
||||
[testenv:pep8]
|
||||
deps =
|
||||
|
Loading…
Reference in New Issue
Block a user