mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-15 01:49:26 +03:00
tests: start basic unit tests for more APIs
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>
This commit is contained in:
15
tests/test_network.py
Normal file
15
tests/test_network.py
Normal file
@ -0,0 +1,15 @@
|
||||
import unittest
|
||||
import libvirt
|
||||
|
||||
|
||||
class TestLibvirtNetwork(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.conn = libvirt.open("test:///default")
|
||||
self.net = self.conn.networkLookupByName("default")
|
||||
|
||||
def tearDown(self):
|
||||
self.net = None
|
||||
self.conn = None
|
||||
|
||||
def testAttr(self):
|
||||
self.assertEqual(self.net.name(), "default")
|
Reference in New Issue
Block a user