From patchwork Mon Jun 13 16:26:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiri Zupka X-Patchwork-Id: 875152 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5DGQUwK024276 for ; Mon, 13 Jun 2011 16:26:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752527Ab1FMQ01 (ORCPT ); Mon, 13 Jun 2011 12:26:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64559 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753000Ab1FMQ00 (ORCPT ); Mon, 13 Jun 2011 12:26:26 -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 p5DGQPdm005390 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 Jun 2011 12:26:25 -0400 Received: from jzupka.local.com (vpn1-6-206.ams2.redhat.com [10.36.6.206]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p5DGQKsb030041; Mon, 13 Jun 2011 12:26:23 -0400 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=BDupka?= To: kvm-autotest@redhat.com, kvm@vger.kernel.org, autotest@test.kernel.org, lmr@redhat.com, ldoktor@redhat.com, akong@redhat.com Cc: jzupka@redhat.com Subject: [AUTOTEST][PATCH 2/2] Extend base_job_unittest for support subtest change. Date: Mon, 13 Jun 2011 18:26:18 +0200 Message-Id: <1307982378-27250-2-git-send-email-jzupka@redhat.com> In-Reply-To: <1307982378-27250-1-git-send-email-jzupka@redhat.com> References: <1307982378-27250-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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 13 Jun 2011 16:26:31 +0000 (UTC) Signed-off-by: Ji?í Župka --- client/common_lib/base_job_unittest.py | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/client/common_lib/base_job_unittest.py b/client/common_lib/base_job_unittest.py index 503b62c..b98b01d 100755 --- a/client/common_lib/base_job_unittest.py +++ b/client/common_lib/base_job_unittest.py @@ -1334,6 +1334,26 @@ class test_job_tags(unittest.TestCase): self.assertEqual(expected, actual) + def test_subtest_with_master_test_path_and_subdir(self): + self.assertEqual( + ('test9', 'subtestdir/test9.subdirtag', 'subdirtag'), + self.job._build_tagged_test_name('test9', + {'master_testpath': 'subtestdir', + 'subdir_tag': 'subdirtag'})) + + + def test_subtest_all_tag_components_together_subdir(self): + self.job.use_sequence_number = True + self.job.automatic_test_tag = 'auto' + expected = ('test10.tag._01_.auto', + 'subtestdir/test10.tag._01_.auto.subdir', + 'tag._01_.auto.subdir') + actual = self.job._build_tagged_test_name( + 'test10', {'tag': 'tag', 'subdir_tag': 'subdir', + 'master_testpath': 'subtestdir'}) + self.assertEqual(expected, actual) + + class test_make_outputdir(unittest.TestCase): def setUp(self): self.resultdir = tempfile.mkdtemp(suffix='unittest')