nova/nova/tests/unit/virt
Balazs Gibizer f8cf050a13 Remove double mocking
In py310 unittest.mock does not allow to mock the same function twice as
the second mocking will fail to autospec the Mock object created by the
first mocking.

This patch manually fixes the double mocking.

Fixed cases:
1) one of the mock was totally unnecessary so it was removed
2) the second mock specialized the behavior of the first generic mock.
   In this case the second mock is replaced with the configuration of
   the first mock
3) a test case with two test steps mocked the same function for each
   step with overlapping mocks. Here the overlap was removed to have
   the two mock exists independently

The get_connection injection in the libvirt functional test needed a
further tweak (yeah I know it has many already) to act like a single
mock (basically case #2) instead of a temporary re-mocking. Still the
globalness of the get_connection mocking warrant the special set / reset
logic there.

Change-Id: I3998d0d49583806ac1c3ae64f1b1fe343cefd20d
2022-08-02 15:31:15 +02:00
..
disk Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
hyperv Remove double mocking 2022-08-02 15:31:15 +02:00
image Use assert(Not)Equal instead of assertTrue(A == X) 2016-06-03 16:53:15 +01:00
ironic Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
libvirt Remove double mocking 2022-08-02 15:31:15 +02:00
powervm Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
vmwareapi Remove double mocking 2022-08-02 15:31:15 +02:00
zvm Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
__init__.py
fakelibosinfo.py Stop sending bad values from libosinfo to libvirt 2019-07-04 15:30:51 +01:00
test_block_device.py Remove double mocking 2022-08-02 15:31:15 +02:00
test_configdrive.py image_meta: Provide image_ref as the id when fetching from instance 2021-05-20 16:57:24 +01:00
test_events.py
test_fake.py
test_hardware.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_imagecache.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_images.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_netutils.py Remove unnecessary code 2017-07-28 06:01:21 +00:00
test_osinfo.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_virt.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00
test_virt_drivers.py Use unittest.mock instead of third party mock 2022-08-01 17:46:26 +02:00