public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/test/, PMSTestSuite/library/standard/basic/, ...
@ 2011-06-14  8:32 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2011-06-14  8:32 UTC (permalink / raw
  To: gentoo-commits

commit:     e9772808cad810718561b6bfd58924910c4d953d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 14 07:57:40 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 14 07:58:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=e9772808

Generate test DESCRIPTIONs from docstrings.

---
 PMSTestSuite/library/__init__.py                   |    2 ++
 PMSTestSuite/library/case.py                       |    5 +++++
 PMSTestSuite/library/standard/basic/depend.py      |   13 +++++--------
 PMSTestSuite/library/standard/basic/doins_fail.py  |    6 ++----
 .../library/standard/basic/phase_function_order.py |    6 ++----
 PMSTestSuite/library/test/random_test.py           |    8 +-------
 6 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/PMSTestSuite/library/__init__.py b/PMSTestSuite/library/__init__.py
index 545a211..fe045f9 100644
--- a/PMSTestSuite/library/__init__.py
+++ b/PMSTestSuite/library/__init__.py
@@ -12,6 +12,8 @@
 >>> files = t.get_output_files()
 >>> files # doctest: +ELLIPSIS
 {'pms-test/random-example/random-example-0.ebuild': ...}
+>>> t.ebuild_vars['DESCRIPTION']
+'An absolutely random test'
 >>> f = files.values()[0]
 >>> str(f) # doctest: +ELLIPSIS
 '# Copyright 1999...inherit pms-test...die...'

diff --git a/PMSTestSuite/library/case.py b/PMSTestSuite/library/case.py
index 291149b..33f66ac 100644
--- a/PMSTestSuite/library/case.py
+++ b/PMSTestSuite/library/case.py
@@ -51,6 +51,11 @@ class TestCase(object):
 		"""
 		self._finalized = True
 
+		if 'DESCRIPTION' not in self.ebuild_vars:
+			descdoc = ' '.join(self.__doc__.split())
+
+			self.ebuild_vars['DESCRIPTION'] = descdoc.rstrip('.')
+
 class EbuildTestCase(TestCase):
 	"""
 	Test case using a single ebuild (per EAPI).

diff --git a/PMSTestSuite/library/standard/basic/depend.py b/PMSTestSuite/library/standard/basic/depend.py
index 2ac57ff..5bafd90 100644
--- a/PMSTestSuite/library/standard/basic/depend.py
+++ b/PMSTestSuite/library/standard/basic/depend.py
@@ -6,15 +6,12 @@ from PMSTestSuite.library.standard.dbus_case import DBusEbuildTestCase
 from PMSTestSuite.library.depend_case import EbuildDependencyTestCase
 
 class EbuildToucher(DBusEbuildTestCase):
-	ebuild_vars = {
-		'DESCRIPTION': 'A random dependency ebuild'
-	}
+	""" Touched file installer (for dependency tests). """
 
-class DependTest(EbuildDependencyTestCase):
-	relevant_eapis = (0,)
+	pass
 
-	ebuild_vars = {
-		'DESCRIPTION': 'DEPEND fulfilling test'
-	}
+class DependTest(EbuildDependencyTestCase):
+	""" DEPEND fulfilling test. """
 
+	relevant_eapis = (0,)
 	depend_classes = [EbuildToucher]

diff --git a/PMSTestSuite/library/standard/basic/doins_fail.py b/PMSTestSuite/library/standard/basic/doins_fail.py
index 841c02b..9242d16 100644
--- a/PMSTestSuite/library/standard/basic/doins_fail.py
+++ b/PMSTestSuite/library/standard/basic/doins_fail.py
@@ -5,11 +5,9 @@
 from PMSTestSuite.library.standard.dbus_case import DBusEbuildTestCase
 
 class DoInsFailureTest(DBusEbuildTestCase):
-	relevant_eapis = (0, 4)
+	""" doins() failure handling test. """
 
-	ebuild_vars = {
-		'DESCRIPTION': 'do*() failure handling test'
-	}
+	relevant_eapis = (0, 4)
 
 	phase_funcs = {
 		'src_install': [

diff --git a/PMSTestSuite/library/standard/basic/phase_function_order.py b/PMSTestSuite/library/standard/basic/phase_function_order.py
index 8475d72..b829349 100644
--- a/PMSTestSuite/library/standard/basic/phase_function_order.py
+++ b/PMSTestSuite/library/standard/basic/phase_function_order.py
@@ -5,11 +5,9 @@
 from PMSTestSuite.library.standard.dbus_case import DBusEbuildTestCase
 
 class PhaseFunctionOrderTest(DBusEbuildTestCase):
-	relevant_eapis = (0, 2, 4)
+	""" Phase function execution order test. """
 
-	ebuild_vars = {
-		'DESCRIPTION': 'Phase function execution order test'
-	}
+	relevant_eapis = (0, 2, 4)
 
 	def __init__(self, *args, **kwargs):
 		DBusEbuildTestCase.__init__(self, *args, **kwargs)

diff --git a/PMSTestSuite/library/test/random_test.py b/PMSTestSuite/library/test/random_test.py
index 088bda5..07096df 100644
--- a/PMSTestSuite/library/test/random_test.py
+++ b/PMSTestSuite/library/test/random_test.py
@@ -5,17 +5,11 @@
 from PMSTestSuite.library.case import EbuildTestCase
 
 class RandomExampleTest(EbuildTestCase):
-	"""
-	Absolutely random TestCase subclass to test it.
-	"""
+	""" An absolutely random test. """
 
 	relevant_eapis = (0, 1, 2, 4)
 	expect_failure = True
 
-	ebuild_vars = {
-		'DESCRIPTION': 'A really random test'
-	}
-
 	phase_funcs = {
 		'pkg_setup': ['die "Random failure"']
 	}



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-14  8:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14  8:32 [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/test/, PMSTestSuite/library/standard/basic/, 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