aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pmstestsuite/library/standard/dbus_case.py')
-rw-r--r--pmstestsuite/library/standard/dbus_case.py36
1 files changed, 27 insertions, 9 deletions
diff --git a/pmstestsuite/library/standard/dbus_case.py b/pmstestsuite/library/standard/dbus_case.py
index a76bba4..6bfbd88 100644
--- a/pmstestsuite/library/standard/dbus_case.py
+++ b/pmstestsuite/library/standard/dbus_case.py
@@ -52,7 +52,10 @@ class RunningTest(dbus.service.Object):
def __init__(self, test):
"""
- Initialize the D-Bus object for test <test>.
+ Initialize the D-Bus object for the test.
+
+ @param test: the test
+ @type test: L{TestCase}
"""
self.test = test
self.reset()
@@ -73,14 +76,21 @@ class RunningTest(dbus.service.Object):
dbus_interface=dbus_interface_name,
in_signature='', out_signature='')
def test_started(self):
- """ Notify the test suite that a particular test has been started. """
+ """
+ Notify the test suite that a particular test has been started.
+ """
self.test.dbus_started = True
@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. """
+ """
+ Append the string to the test output.
+
+ @param l: result string
+ @type l: C{dbus.UTF8String}
+ """
self.test.dbus_output.append(str(l))
class DBusBaseTestCase(object):
@@ -92,19 +102,27 @@ class DBusBaseTestCase(object):
self._dbusobj = RunningTest(self)
def _finalize(self):
- """ Finalize the object, ensuring pkg_setup() will be called. """
+ """
+ Finalize the object, ensuring that C{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 <output> sent through D-Bus matches expected test
+ Check whether the output 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 EbuildTestCase.check_result().
+ alike L{EbuildTestCase.check_result()}.
+
+ @param output: the D-Bus output
+ @type output: list(str)
+ @param pm: the package manager instance
+ @type pm: L{PackageManager}
+ @return: C{True} if output matches expected test result, C{False}
+ otherwise
+ @rtype: bool
"""
pass
@@ -118,7 +136,7 @@ class DBusBaseTestCase(object):
self.check_dbus_result(self._pop_dbus_output(), pm)
class DBusEbuildTestCase(DBusBaseTestCase, EbuildTestCase):
- """ D-Bus capable base test case. """
+ """ D-Bus capable ebuild test case. """
def __init__(self, *args, **kwargs):
""" Initialize the test case and the D-Bus object for it. """