1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-03 08:21:58 +03:00

Add support for running unit tests with nose

Make the 'python setup.py test' able to run unit tests
found under tests/ through the 'nosetests' command

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange
2014-03-18 11:11:48 +00:00
parent 69c4600d61
commit eaded7bdad
2 changed files with 21 additions and 0 deletions

16
tests/test_conn.py Normal file
View File

@ -0,0 +1,16 @@
import unittest
import libvirt
class TestLibvirtConn(unittest.TestCase):
def setUp(self):
self.conn = libvirt.open("test:///default")
def tearDown(self):
self.conn = None
def testConnDomainList(self):
doms = self.conn.listAllDomains()
self.assertEquals(len(doms), 1)
self.assertEquals(type(doms[0]), libvirt.virDomain)
self.assertEquals(doms[0].name(), "test")