From patchwork Fri Mar 29 17:14:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiri Zupka X-Patchwork-Id: 2366191 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 016AAE014A for ; Fri, 29 Mar 2013 17:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756011Ab3C2ROW (ORCPT ); Fri, 29 Mar 2013 13:14:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37392 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754127Ab3C2ROU (ORCPT ); Fri, 29 Mar 2013 13:14:20 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2THEKSP014711 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 29 Mar 2013 13:14:20 -0400 Received: from jzupka-pc.local.com (vpn1-6-43.ams2.redhat.com [10.36.6.43]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2THEDLx032179; Fri, 29 Mar 2013 13:14:18 -0400 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=BDupka?= To: virt-test-devel@redhat.com, kvm@vger.kernel.org, kvm-autotest@redhat.com, lmr@redhat.com, ldoktor@redhat.com, jzupka@redhat.com, ehabkost@redhat.com, pbonzini@redhat.com Subject: [virt-test][PATCH 2/7] virt: Update cartesian config unittest Date: Fri, 29 Mar 2013 18:14:05 +0100 Message-Id: <1364577250-2637-3-git-send-email-jzupka@redhat.com> In-Reply-To: <1364577250-2637-1-git-send-email-jzupka@redhat.com> References: <1364577250-2637-1-git-send-email-jzupka@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Ji?í Župka --- 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):