nova/nova/tests/unit/virt/disk
melanie witt ecb11043e9 Add mock to avoid loading guestfs in unit test
We recently discovered that when the perfect conditions are present
where:

  * libguestfs-dev/el and guestfs python bindings are installed

and

  * unit tests are not being run in a venv or guestfs python bindings
    are installed in the tox venv

the test will end up loading the guestfs module and try to call the
real guestfs and possibly libvirt and fail because of it.

Our unit tests shouldn't be loading modules like guestfs, so this adds
proper mocking to the test along with a poison fixture that will
prevent future accidental imports of such modules.

Closes-Bug: #1994913

Change-Id: I676ee1fd33cf053681a07448759c28f0f2ad79d1
2023-01-05 01:51:32 +00:00
..
mount Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
vfs Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
__init__.py
test_api.py Add mock to avoid loading guestfs in unit test 2023-01-05 01:51:32 +00:00
test_inject.py Stop using mox stubs in nova/tests/unit/virt/disk 2016-11-21 20:39:26 +09:00