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 1Qkzo7-0000he-LH for garchives@archives.gentoo.org; Sun, 24 Jul 2011 14:37:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9D47B21C0CB; Sun, 24 Jul 2011 14:37:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6F5A521C0E1 for ; Sun, 24 Jul 2011 14:37:19 +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 05C4E1BC00A for ; Sun, 24 Jul 2011 14:37:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 58BD48003F for ; Sun, 24 Jul 2011 14:37:18 +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: <0b2bb643556bdfaf5085b87f3b78dbea6bcdc43e.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/dbus_case.py X-VCS-Directories: pmstestsuite/library/standard/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 0b2bb643556bdfaf5085b87f3b78dbea6bcdc43e Date: Sun, 24 Jul 2011 14:37:18 +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: 0d4e9edaa62fe5542e63b6f6f64fcc87 commit: 0b2bb643556bdfaf5085b87f3b78dbea6bcdc43e Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Sun Jul 24 14:15:55 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Sun Jul 24 14:38:22 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D0b2bb643 'D-Bus wrap' eclass dependency test case. --- pmstestsuite/library/standard/dbus_case.py | 34 ++++++++++++++++++++++= +++++- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/pmstestsuite/library/standard/dbus_case.py b/pmstestsuite/li= brary/standard/dbus_case.py index d8fb068..8bc1c99 100644 --- a/pmstestsuite/library/standard/dbus_case.py +++ b/pmstestsuite/library/standard/dbus_case.py @@ -5,7 +5,8 @@ import dbus.service =20 from pmstestsuite.library.case import EbuildTestCase -from pmstestsuite.library.depend_case import EbuildDependencyTestCase +from pmstestsuite.library.depend_case import EbuildDependencyTestCase, \ + EclassDependencyTestCase from pmstestsuite.library.eclass_case import EclassTestCase =20 from pmstestsuite.dbus_handler import DBusHandler, dbus_interface_name, = dbus_object_prefix @@ -168,3 +169,34 @@ class DBusEbuildDependencyTestCase(EbuildDependencyT= estCase): def check_result(self, pm): return self.dbus_started !=3D self.expect_failure \ and self.check_dbus_result('\n'.join(self.dbus_output), pm) + +class DBusEclassDependencyTestCase(EclassDependencyTestCase): + """ D-Bus capable eclass dependency test case. """ + + inherits =3D ['pms-test-dbus'] + + def __init__(self, *args, **kwargs): + """ Initialize the test case and the D-Bus object for it. """ + EclassDependencyTestCase.__init__(self, *args, **kwargs) + self._dbusobj =3D RunningTest(self) + + def _finalize(self): + """ Finalize the object, ensuring pkg_setup() will be called. """ + if self.phase_funcs['pkg_setup']: + self.phase_funcs['pkg_setup'].insert(0, 'pms-test-dbus_pkg_setup') + + def check_dbus_result(self, output, pm): + """ + Check whether the sent through D-Bus matches expected test + output. + + Return True if it does, False otherwise. + + The default implementation simply checks whether the test was merged + alike EclassDependencyTestCase.check_result(). + """ + return EclassDependencyTestCase.check_result(self, pm) + + def check_result(self, pm): + return self.dbus_started !=3D self.expect_failure \ + and self.check_dbus_result('\n'.join(self.dbus_output), pm)