mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-12-16 12:23:50 +03:00
To prevent regressions, especially with generated code, we need to have test coverage of more APIs. This starts off with coverage for object creation for all object types supported by the test driver currently. This exercises constructors which have been broken several times in the past. Related https://gitlab.com/libvirt/libvirt-python/-/issues/4 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
26 lines
759 B
Python
26 lines
759 B
Python
import unittest
|
|
import libvirt
|
|
|
|
|
|
class TestLibvirtDomain(unittest.TestCase):
|
|
def setUp(self):
|
|
self.conn = libvirt.open("test:///default")
|
|
self.dom = self.conn.lookupByName("test")
|
|
|
|
def tearDown(self):
|
|
self.dom = None
|
|
self.conn = None
|
|
|
|
def testDomainSchedParams(self):
|
|
params = self.dom.schedulerParameters()
|
|
self.assertEquals(len(params), 1)
|
|
self.assertTrue("weight" in params)
|
|
params["weight"] = 100
|
|
self.dom.setSchedulerParameters(params)
|
|
|
|
@unittest.skipIf(libvirt.getVersion() == 4000000,
|
|
"test driver screenshot broken in 4.0.0")
|
|
def testScreenshot(self):
|
|
stream = self.conn.newStream()
|
|
ss = self.dom.screenshot(stream, 0, 0)
|