Francesco Romani has uploaded a new change for review.

Change subject: tests: add an helper schema compliancy check class
......................................................................

tests: add an helper schema compliancy check class

This patch extracts the schema compliancy methods
in a self-contained, reusable class.

Change-Id: Iaa07999576c3ace6b5ee7e3e30494bdc9c40d400
Signed-off-by: Francesco Romani <[email protected]>
---
M tests/vmApiTests.py
1 file changed, 12 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/10/28910/1

diff --git a/tests/vmApiTests.py b/tests/vmApiTests.py
index a616d45..260c98a 100644
--- a/tests/vmApiTests.py
+++ b/tests/vmApiTests.py
@@ -31,16 +31,7 @@
 from vmTests import FakeVM
 
 
-@contextmanager
-def ensureVmStats(vm):
-    vm._initVmStats()
-    try:
-        yield vm
-    finally:
-        vm._vmStats.stop()
-
-
-class TestVmStats(TestCaseBase):
+class TestSchemaCompliancyBase(TestCaseBase):
     @utils.memoized
     def _getAPI(self):
         testPath = os.path.realpath(__file__)
@@ -61,6 +52,17 @@
                 self.assertIn(apiItem, stats)
         # TODO: type checking
 
+
+@contextmanager
+def ensureVmStats(vm):
+    vm._initVmStats()
+    try:
+        yield vm
+    finally:
+        vm._vmStats.stop()
+
+
+class TestVmStats(TestSchemaCompliancyBase):
     def testDownStats(self):
         with FakeVM() as fake:
             fake.setDownStatus(define.ERROR, vmexitreason.GENERIC_ERROR)


-- 
To view, visit http://gerrit.ovirt.org/28910
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa07999576c3ace6b5ee7e3e30494bdc9c40d400
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to