mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
tests: python: drop skipUnlessLibvirtHasCPointer
This was added in 2014, we can safely depend on it being available now. Existing tests will ensure it doesn't regress Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
@@ -32,7 +32,6 @@ from .tests_helper import *
|
||||
@skipIfEnvironmentVariableSet("SKIP_TEST820RHBZ912499_PY")
|
||||
@skipUnlessArchMatches("(i.86|x86_64)")
|
||||
@skipUnlessGuestfsBackendIs('libvirt')
|
||||
@skipUnlessLibvirtHasCPointer()
|
||||
class Test820RHBZ912499(unittest.TestCase):
|
||||
def setUp(self):
|
||||
# Create a test disk.
|
||||
|
||||
@@ -29,7 +29,6 @@ guestsdir = os.environ['guestsdir']
|
||||
|
||||
|
||||
@skipUnlessConfiguredWithLibvirt()
|
||||
@skipUnlessLibvirtHasCPointer()
|
||||
class Test910Libvirt(unittest.TestCase):
|
||||
def test_libvirt(self):
|
||||
import libvirt
|
||||
|
||||
@@ -48,23 +48,6 @@ def skipUnlessConfiguredWithLibvirt():
|
||||
return lambda func: func
|
||||
|
||||
|
||||
def skipUnlessLibvirtHasCPointer():
|
||||
"""
|
||||
Skip the current class/method if:
|
||||
(a) libvirt cannot be imported (e.g. not installed)
|
||||
(b) connection objects don't have the c_pointer() method (too old)
|
||||
"""
|
||||
try:
|
||||
import libvirt
|
||||
except ImportError:
|
||||
return unittest.skip("could not import libvirt")
|
||||
# Check we're using the version of libvirt-python that has
|
||||
# c_pointer() methods.
|
||||
if "c_pointer" not in dir(libvirt.open(None)):
|
||||
return unittest.skip("libvirt-python doesn't support c_pointer()")
|
||||
return lambda func: func
|
||||
|
||||
|
||||
def skipUnlessGuestfsBackendIs(wanted):
|
||||
"""
|
||||
Skip the current class/method if the default backend of libguestfs
|
||||
|
||||
Reference in New Issue
Block a user