The test_get_domain_info_with_more_return() unit test was causing
failure on some systems where lxml was not capable of handling None for
the xml to parse. However, our unit tests should not be testing libvirt;
the unit tests in libvirt already do that. Our unit tests should simply
test the code boundaries of the unit of code that they wish to stress,
and not anything further.
This patch changes the unit test in question to only test the code
within the libvirt_driver.LibvirtDriver.get_info() method, and nothing
more, and in doing so, we remove any calls at all to libvirt and mock
out where the code passes the boundaries of the get_info() method.
Reviewed: https:/ /review. openstack. org/85632 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=570a84e92c8 8b1c7d9fd48d107 bc3fad75e32efe
Committed: https:/
Submitter: Jenkins
Branch: master
commit 570a84e92c88b1c 7d9fd48d107bc3f ad75e32efe
Author: Jay Pipes <email address hidden>
Date: Mon Apr 7 00:50:09 2014 -0400
Correct test boundary for libvirt_ driver. get_info
The test_get_ domain_ info_with_ more_return( ) unit test was causing
failure on some systems where lxml was not capable of handling None for
the xml to parse. However, our unit tests should not be testing libvirt;
the unit tests in libvirt already do that. Our unit tests should simply
test the code boundaries of the unit of code that they wish to stress,
and not anything further.
This patch changes the unit test in question to only test the code driver. LibvirtDriver. get_info( ) method, and nothing
within the libvirt_
more, and in doing so, we remove any calls at all to libvirt and mock
out where the code passes the boundaries of the get_info() method.
Change-Id: I022cc331a980c2 a4d98f16d2d77b2 4839b528464
Closes-bug: #1301602