[virt-test][PATCH 2/7] virt: Update cartesian config unittest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jiří Župka <jzupka@xxxxxxxxxx>
---
 virttest/cartesian_config_unittest.py | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/virttest/cartesian_config_unittest.py b/virttest/cartesian_config_unittest.py
index c72cb71..afc1b14 100755
--- a/virttest/cartesian_config_unittest.py
+++ b/virttest/cartesian_config_unittest.py
@@ -1,4 +1,3 @@
-#!/usr/bin/python
 import unittest, logging, os
 import gzip
 import cartesian_config
@@ -38,13 +37,11 @@ class CartesianConfigTest(unittest.TestCase):
         self._checkDictionaries(p, reference)
 
 
-    def _checkStringDump(self, string, dump):
-        p = cartesian_config.Parser()
+    def _checkStringDump(self, string, dump, defaults=False):
+        p = cartesian_config.Parser(defaults=defaults)
         p.parse_string(string)
 
-        dumpdata = None
-        exec "dumpdata = " + dump
-        self._checkDictionaries(p, dumpdata)
+        self._checkDictionaries(p, dump)
 
 
     def testSimpleVariant(self):
@@ -75,17 +72,18 @@ class CartesianConfigTest(unittest.TestCase):
                         no unknown_qemu
                 - testB:
             """,
-            """[
-{'dep': [],
- 'name': 'testA.kvm.unknown_qemu',
- 'shortname': 'testA.kvm.unknown_qemu'},
-{'dep': [],
- 'name': 'testB.kvm.unknown_qemu',
- 'shortname': 'testB.kvm.unknown_qemu'},
-{'dep': [],
- 'name': 'testB.nokvm.unknown_qemu',
- 'shortname': 'testB.nokvm.unknown_qemu'},
-]""")
+            [
+                {'dep': [],
+                 'name': 'testA.kvm.unknown_qemu',
+                 'shortname': 'testA.kvm.unknown_qemu'},
+                {'dep': [],
+                 'name': 'testB.kvm.unknown_qemu',
+                 'shortname': 'testB.kvm.unknown_qemu'},
+                {'dep': [],
+                 'name': 'testB.nokvm.unknown_qemu',
+                 'shortname': 'testB.nokvm.unknown_qemu'},
+            ]
+            )
 
 
     def testHugeTest1(self):
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux