summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2014-03-18 11:11:48 +0000
committerDaniel P. Berrange <berrange@redhat.com>2014-03-19 15:16:15 +0000
commiteaded7bdadf3ccdc4b208ec0ed65a1b23b8b5f69 (patch)
tree894d5dd6ca0ef88908550bf1db64824af7bb810b /tests
parent69c4600d61fa74c4977d2471a29fb73f0fe5edb0 (diff)
downloadlibvirt-python-eaded7bdadf3ccdc4b208ec0ed65a1b23b8b5f69.tar.gz
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_conn.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_conn.py b/tests/test_conn.py
new file mode 100644
index 0000000..9fee099
--- /dev/null
+++ b/tests/test_conn.py
@@ -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")