From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QPUwZ-00065t-Pv for garchives@archives.gentoo.org; Thu, 26 May 2011 07:25:20 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A25171C02D; Thu, 26 May 2011 07:25:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 673341C061 for ; Thu, 26 May 2011 07:25:09 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C2FDE1B400D for ; Thu, 26 May 2011 07:25:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 386558050A for ; Thu, 26 May 2011 07:25:08 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <8a0fabc3d56d57f69f86643d2add3ce535e9bd0d.mgorny@gentoo> Subject: [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: PMSTestSuite/library/case.py X-VCS-Directories: PMSTestSuite/library/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 8a0fabc3d56d57f69f86643d2add3ce535e9bd0d Date: Thu, 26 May 2011 07:25:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: a28612af4fba6053a47be10feb8b8b16 commit: 8a0fabc3d56d57f69f86643d2add3ce535e9bd0d Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Thu May 26 07:22:23 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Thu May 26 07:22:23 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D8a0fabc3 Move class name -> PM code into separate function. --- PMSTestSuite/library/case.py | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/PMSTestSuite/library/case.py b/PMSTestSuite/library/case.py index 2908342..02a3b9f 100644 --- a/PMSTestSuite/library/case.py +++ b/PMSTestSuite/library/case.py @@ -21,6 +21,15 @@ inherit pms-test =20 pn_re =3D re.compile('(.)([A-Z])') =20 +def cleanup_test_case_name(classname): + """ + Create the ebuild PN from . + """ + + if classname.endswith('Test'): + classname =3D classname[:-4] + return pn_re.sub('\\1-\\2', classname).lower() + class TestCase(object): """ Base class for a test case. """ pass @@ -77,10 +86,7 @@ class EbuildTestCase(TestCase): =20 return ''.join(contents) =20 - pn =3D self.__class__.__name__ - if pn.endswith('Test'): - pn =3D pn[:-4] - pn =3D pn_re.sub('\\1-\\2', pn).lower() + pn =3D cleanup_test_case_name(self.__class__.__name__) fn =3D 'pms-test/%s/%s-%s.ebuild' % (pn, pn, self.eapi) =20 return {fn: EbuildTestCaseEbuildFile(self)}