1
0
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:
Daniel P. Berrangé
2020-10-06 11:01:42 +01:00
parent 613411502d
commit 1f44167510
7 changed files with 109 additions and 0 deletions

15
tests/test_network.py Normal file
View 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")