public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/standard/, PMSTestSuite/
@ 2011-05-31 19:18 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2011-05-31 19:18 UTC (permalink / raw
  To: gentoo-commits

commit:     e9b2e125ea2e8b916a90def4cce83e3dc2460c52
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 31 19:04:39 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 31 19:04:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=e9b2e125

Fix having shared dbus_output.

---
 PMSTestSuite/dbus_handler.py               |    1 +
 PMSTestSuite/library/standard/dbus_case.py |    1 -
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/PMSTestSuite/dbus_handler.py b/PMSTestSuite/dbus_handler.py
index 89e2ac5..b4b3e4b 100644
--- a/PMSTestSuite/dbus_handler.py
+++ b/PMSTestSuite/dbus_handler.py
@@ -16,6 +16,7 @@ class RunningTest(dbus.service.Object):
 		Initialize the object for test <test>, for DBusHandler <parent>.
 		"""
 		self.test = test
+		self.test.dbus_output = []
 		dbus.service.Object.__init__(
 				self,
 				parent.bus,

diff --git a/PMSTestSuite/library/standard/dbus_case.py b/PMSTestSuite/library/standard/dbus_case.py
index 8e9db92..0683a0d 100644
--- a/PMSTestSuite/library/standard/dbus_case.py
+++ b/PMSTestSuite/library/standard/dbus_case.py
@@ -9,7 +9,6 @@ dbus_handler = DBusHandler()
 
 class DBusEbuildTestCase(EbuildTestCase):
 	""" D-Bus capable base test case. """
-	dbus_output = []
 
 	def __init__(self, *args, **kwargs):
 		""" Initialize the test case and the D-Bus object for it. """



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/standard/, PMSTestSuite/
@ 2011-06-03 17:36 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2011-06-03 17:36 UTC (permalink / raw
  To: gentoo-commits

commit:     fba9e6ada39b2f93715d2e1843ccf219b3ca6951
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  3 16:47:52 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jun  3 16:47:52 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=fba9e6ad

Move RunningTest to ...library.standard.dbus_case.

---
 PMSTestSuite/dbus_handler.py               |   28 +---------------------------
 PMSTestSuite/library/standard/dbus_case.py |   28 ++++++++++++++++++++++++++--
 2 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/PMSTestSuite/dbus_handler.py b/PMSTestSuite/dbus_handler.py
index b4b3e4b..ddacb6b 100644
--- a/PMSTestSuite/dbus_handler.py
+++ b/PMSTestSuite/dbus_handler.py
@@ -2,34 +2,12 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-import dbus, dbus.service
+import dbus
 from dbus.mainloop.glib import DBusGMainLoop
 
 dbus_interface_name = 'org.gentoo.PMSTestSuite'
 dbus_object_prefix = '/org/gentoo/PMSTestSuite'
 
-class RunningTest(dbus.service.Object):
-	""" A class encapsulating a running test. """
-
-	def __init__(self, test, parent):
-		"""
-		Initialize the object for test <test>, for DBusHandler <parent>.
-		"""
-		self.test = test
-		self.test.dbus_output = []
-		dbus.service.Object.__init__(
-				self,
-				parent.bus,
-				'%s/%s' % (dbus_object_prefix, test.p.replace('-', '_'))
-		)
-
-	@dbus.service.method(
-			dbus_interface=dbus_interface_name,
-			in_signature='s', out_signature='')
-	def append_output(self, l):
-		""" Append the line <l> to the test output. """
-		self.test.dbus_output.append(l)
-
 class DBusHandler(object):
 	""" A class handling all D-Bus interaction for PMS Test Suite. """
 
@@ -38,7 +16,3 @@ class DBusHandler(object):
 		DBusGMainLoop(set_as_default=True)
 		self.bus = dbus.SystemBus()
 		self.busname = dbus.service.BusName(dbus_interface_name, self.bus)
-
-	def add_test(self, test):
-		""" Add the object for <test> to the handler. """
-		test._dbusobj = RunningTest(test, self)

diff --git a/PMSTestSuite/library/standard/dbus_case.py b/PMSTestSuite/library/standard/dbus_case.py
index 5769304..08778fa 100644
--- a/PMSTestSuite/library/standard/dbus_case.py
+++ b/PMSTestSuite/library/standard/dbus_case.py
@@ -2,18 +2,42 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
+import dbus.service
+
 from PMSTestSuite.library.case import EbuildTestCase
-from PMSTestSuite.dbus_handler import DBusHandler, RunningTest
+from PMSTestSuite.dbus_handler import DBusHandler, dbus_interface_name, dbus_object_prefix
 
 dbus_handler = DBusHandler()
 
+class RunningTest(dbus.service.Object):
+	""" A class encapsulating a running test. """
+
+	def __init__(self, test):
+		"""
+		Initialize the D-Bus object for test <test>.
+		"""
+		self.test = test
+		self.test.dbus_output = []
+		dbus.service.Object.__init__(
+				self,
+				dbus_handler.bus,
+				'%s/%s' % (dbus_object_prefix, test.p.replace('-', '_'))
+		)
+
+	@dbus.service.method(
+			dbus_interface=dbus_interface_name,
+			in_signature='s', out_signature='')
+	def append_output(self, l):
+		""" Append the line <l> to the test output. """
+		self.test.dbus_output.append(l)
+
 class DBusEbuildTestCase(EbuildTestCase):
 	""" D-Bus capable base test case. """
 
 	def __init__(self, *args, **kwargs):
 		""" Initialize the test case and the D-Bus object for it. """
 		EbuildTestCase.__init__(self, *args, **kwargs)
-		dbus_handler.add_test(self)
+		self._dbusobj = RunningTest(self)
 
 	def check_result(self, res):
 		return self.check_output('\n'.join(self.dbus_output))



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-03 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-03 17:36 [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/standard/, PMSTestSuite/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2011-05-31 19:18 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox