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 1RhpzF-0001GL-IN for garchives@archives.gentoo.org; Mon, 02 Jan 2012 22:04:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4F87021C176; Mon, 2 Jan 2012 22:03:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0C69B21C173 for ; Mon, 2 Jan 2012 22:03:46 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 771481B400B for ; Mon, 2 Jan 2012 22:03:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id AB14F8004F for ; Mon, 2 Jan 2012 22:03:45 +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: <6f58b9a9bc5a1e7314336caec10acabe751d1f94.mgorny@gentoo> Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/standard/, pmstestsuite/library/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: pmstestsuite/library/case.py pmstestsuite/library/standard/dbus_case.py X-VCS-Directories: pmstestsuite/library/standard/ pmstestsuite/library/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 6f58b9a9bc5a1e7314336caec10acabe751d1f94 Date: Mon, 2 Jan 2012 22:03:45 +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: a86b0c7e-75ea-4c08-ab7a-000a137cc97c X-Archives-Hash: 2df94f19d4b8436990c83be80779c64a commit: 6f58b9a9bc5a1e7314336caec10acabe751d1f94 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Mon Jan 2 21:29:24 2012 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Mon Jan 2 21:29:24 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D6f58b9a9 Integrate the D-Bus object with base D-Bus test case class. --- pmstestsuite/library/case.py | 4 +- pmstestsuite/library/standard/dbus_case.py | 32 +++++++++-------------= ----- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/pmstestsuite/library/case.py b/pmstestsuite/library/case.py index a5817fb..614a500 100644 --- a/pmstestsuite/library/case.py +++ b/pmstestsuite/library/case.py @@ -1,5 +1,5 @@ # vim:fileencoding=3Dutf-8 -# (c) 2011 Micha=C5=82 G=C3=B3rny +# (c) 2011-2012 Micha=C5=82 G=C3=B3rny # Released under the terms of the 2-clause BSD license. =20 import copy, itertools, random, re @@ -227,7 +227,7 @@ class NotEqualAssertionResult(EqualAssertionResult): return '%s !=3D %s' % (self.actual, repr(self._expect)) =20 -class TestCase(ABCObject): +class TestCase(object): # was: ABCObject """ Base class for a test case. =20 diff --git a/pmstestsuite/library/standard/dbus_case.py b/pmstestsuite/li= brary/standard/dbus_case.py index 672ace5..ac9c4d1 100644 --- a/pmstestsuite/library/standard/dbus_case.py +++ b/pmstestsuite/library/standard/dbus_case.py @@ -1,5 +1,5 @@ # vim:fileencoding=3Dutf-8 -# (c) 2011 Micha=C5=82 G=C3=B3rny +# (c) 2011-2012 Micha=C5=82 G=C3=B3rny # Released under the terms of the 2-clause BSD license. =20 import dbus.service @@ -13,30 +13,26 @@ from pmstestsuite.dbus_handler import DBusHandler, db= us_interface_name, dbus_obj =20 dbus_handler =3D DBusHandler() =20 -class RunningTest(dbus.service.Object): - """ A class encapsulating a running test. """ +class DBusBaseTestCase(dbus.service.Object): + """ A base D-Bus test case class. """ =20 - def __init__(self, test): + def __init__(self): """ - Initialize the D-Bus object for the test. - - @param test: the test - @type test: L{TestCase} + Initialize the D-Bus interface for the test. """ - self.test =3D test self.reset() dbus.service.Object.__init__( self, dbus_handler.bus, - '%s/%s' % (dbus_object_prefix, test.p.replace('-', '_')) + '%s/%s' % (dbus_object_prefix, self.p.replace('-', '_')) ) =20 def reset(self): """ Reset test results. """ - self.test.dbus_output =3D [] - self.test.dbus_started =3D False + self.dbus_output =3D [] + self.dbus_started =3D False =20 @dbus.service.method( dbus_interface=3Ddbus_interface_name, @@ -45,7 +41,7 @@ class RunningTest(dbus.service.Object): """ Notify the test suite that a particular test has been started. """ - self.test.dbus_started =3D True + self.dbus_started =3D True =20 @dbus.service.method( dbus_interface=3Ddbus_interface_name, @@ -57,13 +53,7 @@ class RunningTest(dbus.service.Object): @param l: result string @type l: C{dbus.UTF8String} """ - self.test.dbus_output.append(str(l)) - -class DBusBaseTestCase(object): - """ A base D-Bus test case class. """ - - def __init__(self): - self._dbusobj =3D RunningTest(self) + self.dbus_output.append(str(l)) =20 def _finalize(self): """ @@ -92,7 +82,7 @@ class DBusBaseTestCase(object): =20 def _pop_dbus_output(self): ret =3D self.dbus_output - self._dbusobj.reset() + self.reset() return ret =20 def check_result(self, pm):