Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I24c8926bc7a571b45af77c497f0791d101ebbc12
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Autospecing will ensure that the method signatures are respected
during calls.
oslotest.mock_fixture contains 2 components, one of them adds the autospec
argument to mock.Mock and mock.MagicMock, while the other one fixes the
autospec behaviour for mock.patch functions, and sets autospec to True by
default, unless otherwise specified.
Closes-Bug: #1735588
Change-Id: I5a1dd8571988859b4a14a505fd5e016079582363
A Planned VM and a Realized VM cannot exist at the time on the
same host, The 2 types must be treated separately.
vm_exists will only check if the Realized VM exists.
planned_vm_exists will only check if the Planned VM exists.
destroy_planned_vm will only destroy the planned VM, if it exists.
Related-Bug: #1604078
Change-Id: I91636a82b057f566eab9887c422911163668f556
When using WMI, the resources passed to the
Msvm_VirtualSystemManagementService are not cleaned up
by the garbage collector if the Service object is still
referenced (cached as a property in BaseUtilsVirt).
PyMI doesn't have this issue, so the Service objects can be
safely cached.
This issue only affects Windows / Hyper-V Server 2012.
Change-Id: If8df0bf0a2f13a9e94993dde8b2a18943f2e9f83
Closes-Bug: #1697389
This patch only affects Windows / Hyper-V Server 2012.
On Windows / Hyper-V Server 2012_compat_conn represents the old WMI
connection, in order to ensure that the add / update operations work
properly, since PyMI's and WMI's GetText_(1) outputs are different,
causing an issue on 2012.
Closes-Bug: #1678968
Change-Id: I5542046375114c24387cbcfba0aa8528f8e0dd6d
A previous commit introduced new files with CRLF line endings.
They need to be changed to LF endings, to be like the rest of
the repository
Change-Id: I054270e0aec6b7b94c92659bcd8c1cd1ebaeabef
The imports should be split into: native, 3rd party, and
project imports. However, there are some cases in which
this isn't true.
Change-Id: I6d1c0c13c8c258c669f78473aecde0d771af38ba
Until recently, os-win did not have any functional tests. As we're
now starting to add such tests, we need to clearly separate unit
tests.
Note that most OpenStack projects have already done this separation.
This change moves the unit tests to a separate folder.
Change-Id: I1649fae7095f9b4024e526358ac70a58189365bf