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 1QoWe1-0001av-AN for garchives@archives.gentoo.org; Wed, 03 Aug 2011 08:17:37 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E32221C1A1; Wed, 3 Aug 2011 08:17:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3E75D21C1A1 for ; Wed, 3 Aug 2011 08:17:30 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 808DF2AC008 for ; Wed, 3 Aug 2011 08:17:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 431B080042 for ; Wed, 3 Aug 2011 08:17:27 +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: <6ae2cc8860a8e9f637c01a727fdeba582b878c78.mgorny@gentoo> Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/standard/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: pmstestsuite/library/standard/eclass_metadata.py pmstestsuite/library/standard/phase_function_order.py pmstestsuite/library/standard/special_vars.py X-VCS-Directories: pmstestsuite/library/standard/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 6ae2cc8860a8e9f637c01a727fdeba582b878c78 Date: Wed, 3 Aug 2011 08:17:27 +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: 4ce83da3fbdaf3dd3084dc61138643fe commit: 6ae2cc8860a8e9f637c01a727fdeba582b878c78 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Wed Aug 3 08:09:38 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Wed Aug 3 08:09:38 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D6ae2cc88 Migrate most of the tests to use assertions. --- pmstestsuite/library/standard/eclass_metadata.py | 13 +++---- .../library/standard/phase_function_order.py | 4 +- pmstestsuite/library/standard/special_vars.py | 33 ++++++++++----= ----- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pmstestsuite/library/standard/eclass_metadata.py b/pmstestsu= ite/library/standard/eclass_metadata.py index 4e5ed15..1ebc05e 100644 --- a/pmstestsuite/library/standard/eclass_metadata.py +++ b/pmstestsuite/library/standard/eclass_metadata.py @@ -41,12 +41,11 @@ class IUseInheritanceTest(VariableInheritanceTest): =20 def check_dbus_result(self, output, pm): # ensure it got installed first - if not DBusEclassTestCase.check_dbus_result(self, output, pm): - return False + DBusEclassTestCase.check_dbus_result(self, output, pm) =20 spl =3D pm.installed[self.atom(pm)].use - return self.var_eclass_value in spl \ - and self.var_ebuild_value in spl + self.assertEqual(sorted(spl), sorted((self.var_eclass_value, + self.var_ebuild_value)), 'IUSE') =20 # XXX: REQUIRED_USE =20 @@ -71,8 +70,8 @@ EXPORT_FUNCTIONS src_compile ''' % self.pn =20 def check_dbus_result(self, output, pm): - if not DBusEclassTestCase.check_dbus_result(self, output, pm): - return False + DBusEclassTestCase.check_dbus_result(self, output, pm) =20 phases =3D pm.installed[self.atom(pm)].defined_phases - return (sorted(phases) =3D=3D ['compile', 'setup']) + self.assertEqual(sorted(phases), ['compile', 'setup'], + 'DEFINED_PHASES') diff --git a/pmstestsuite/library/standard/phase_function_order.py b/pmst= estsuite/library/standard/phase_function_order.py index ce7f03f..65209ce 100644 --- a/pmstestsuite/library/standard/phase_function_order.py +++ b/pmstestsuite/library/standard/phase_function_order.py @@ -42,5 +42,5 @@ src_install pkg_preinst pkg_postinst""" =20 - return (output =3D=3D expect) \ - and DBusEbuildTestCase.check_dbus_result(self, output, pm) + DBusEbuildTestCase.check_dbus_result(self, output, pm) + self.assertEqual(output, expect, 'Executed phases') diff --git a/pmstestsuite/library/standard/special_vars.py b/pmstestsuite= /library/standard/special_vars.py index eab61dc..854a196 100644 --- a/pmstestsuite/library/standard/special_vars.py +++ b/pmstestsuite/library/standard/special_vars.py @@ -14,9 +14,10 @@ class InheritedVariableTest(DBusEbuildTestCase): } =20 def check_dbus_result(self, output, pm): + DBusEbuildTestCase.check_dbus_result(self, output, pm) inherits =3D output.split() - return 'pms-test-dbus' in inherits \ - and DBusEbuildTestCase.check_dbus_result(self, output, pm) + self.assertContains('pms-test-dbus', inherits, + 'INHERITS') =20 class RDependFallbackTest(DBusEbuildTestCase): """ Test whether RDEPEND=3D${DEPEND} fallback works as expected. """ @@ -28,20 +29,21 @@ class RDependFallbackTest(DBusEbuildTestCase): } =20 def check_dbus_result(self, output, pm): - # in EAPI 4, expect empty RDEPEND - # in older EAPIs, expect DEPEND - - if not DBusEbuildTestCase.check_dbus_result(self, output, pm): - return False + DBusEbuildTestCase.check_dbus_result(self, output, pm) =20 - def _has_our_pkg(deps): - for d in deps: - if d.key =3D=3D 'virtual/libc': - return True - return False + class DepMatcher(object): + def __eq__(self, other): + return other.key =3D=3D 'virtual/libc' =20 rdep =3D pm.installed[self.atom(pm)].run_dependencies - return ((self.eapi =3D=3D 4) !=3D _has_our_pkg(rdep)) + mydep =3D DepMatcher() + + # in EAPI 4, expect empty RDEPEND + # in older EAPIs, expect =3D=3D DEPEND + if self.eapi =3D=3D 4: + self.assertEqual(tuple(rdep), (), 'RDEPEND') + else: + self.assertContains(mydep, rdep, 'RDEPEND') =20 class DefinedPhasesTest(DBusEbuildTestCase): """ Test whether DEFINED_PHASES are declared in EAPI 4. """ @@ -54,8 +56,7 @@ class DefinedPhasesTest(DBusEbuildTestCase): } =20 def check_dbus_result(self, output, pm): - if not DBusEbuildTestCase.check_dbus_result(self, output, pm): - return False + DBusEbuildTestCase.check_dbus_result(self, output, pm) =20 phases =3D pm.installed[self.atom(pm)].defined_phases - return (str(phases) =3D=3D 'setup') + self.assertEqual(tuple(phases), ('setup',), 'DEFINED_PHASES')