From 14499d0e86f67f556e2631c687eaf20e82ca9e43 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Tue, 3 Jan 2012 13:14:20 +0100 Subject: Remove old dbus_case API. --- pmstestsuite/library/standard/banned_commands.py | 20 +++----------------- pmstestsuite/library/standard/dbus_case.py | 20 -------------------- pmstestsuite/library/standard/depend.py | 20 +++++++++----------- pmstestsuite/library/standard/deprecated_vars.py | 12 +++++------- pmstestsuite/library/standard/doins_fail.py | 6 +++--- pmstestsuite/library/standard/eclass_depend.py | 12 ++++++------ pmstestsuite/library/standard/eclass_metadata.py | 13 ++++--------- pmstestsuite/library/standard/ext_cases.py | 8 ++++---- .../library/standard/phase_function_order.py | 7 +++---- pmstestsuite/library/standard/special_vars.py | 13 ++++--------- pmstestsuite/library/standard/util.py | 8 ++++---- pmstestsuite/library/standard/variable_scope.py | 6 ++---- pmstestsuite/library/standard/workdir_fallback.py | 6 +++--- 13 files changed, 50 insertions(+), 101 deletions(-) delete mode 100644 pmstestsuite/library/standard/dbus_case.py diff --git a/pmstestsuite/library/standard/banned_commands.py b/pmstestsuite/library/standard/banned_commands.py index 216d6df..7e3de17 100644 --- a/pmstestsuite/library/standard/banned_commands.py +++ b/pmstestsuite/library/standard/banned_commands.py @@ -2,13 +2,13 @@ # (c) 2011-2012 Michał Górny # Released under the terms of the 2-clause BSD license. -from .dbus_case import DBusEbuildTestCase +from pmstestsuite.library.case import EbuildTestCase -class BannedCommandTest(DBusEbuildTestCase): +class BannedCommandTest(EbuildTestCase): supported_eapis = (range(0, 4), (4,)) def __init__(self, *args, **kwargs): - DBusEbuildTestCase.__init__(self, *args, **kwargs) + EbuildTestCase.__init__(self, *args, **kwargs) self._path = '/tmp/pms-test-suite-%d' % id(self) self.phase_funcs['src_install'].extend([ '{ echo > foo; } || die', @@ -31,13 +31,6 @@ class DoHardCommandTest(BannedCommandTest): 'pms-test_dbus_append_result ${?}']) def check_dbus_result(self, output, pm): - try: - BannedCommandTest.check_dbus_result(self, output, pm) - except AssertionError as e: - exc = e - else: - exc = None - try: res = True if output[0] == '0' else False except IndexError: @@ -76,13 +69,6 @@ class DoSedCommandTest(BannedCommandTest): 'pms-test_dbus_append_result "$(cat "${D}"%s/foo)"' % self._path]) def check_dbus_result(self, output, pm): - try: - BannedCommandTest.check_dbus_result(self, output, pm) - except AssertionError as e: - exc = e - else: - exc = None - try: res = output[0].strip() except IndexError: diff --git a/pmstestsuite/library/standard/dbus_case.py b/pmstestsuite/library/standard/dbus_case.py deleted file mode 100644 index 14258b7..0000000 --- a/pmstestsuite/library/standard/dbus_case.py +++ /dev/null @@ -1,20 +0,0 @@ -# vim:fileencoding=utf-8 -# (c) 2011-2012 Michał Górny -# Released under the terms of the 2-clause BSD license. - -from pmstestsuite.library.case import EbuildTestCase -from pmstestsuite.library.depend_case import EbuildDependencyTestCase, \ - EclassDependencyTestCase -from pmstestsuite.library.eclass_case import EclassTestCase - -class DBusEbuildTestCase(EbuildTestCase): - pass - -class DBusEclassTestCase(EclassTestCase): - pass - -class DBusEbuildDependencyTestCase(EbuildDependencyTestCase): - pass - -class DBusEclassDependencyTestCase(EclassDependencyTestCase): - pass diff --git a/pmstestsuite/library/standard/depend.py b/pmstestsuite/library/standard/depend.py index f95f090..843229c 100644 --- a/pmstestsuite/library/standard/depend.py +++ b/pmstestsuite/library/standard/depend.py @@ -2,46 +2,44 @@ # (c) 2011-2012 Michał Górny # Released under the terms of the 2-clause BSD license. -from .dbus_case import DBusEbuildDependencyTestCase +from pmstestsuite.library.depend_case import EbuildDependencyTestCase from .util import EbuildToucher, FailingEbuild -class DependTest(DBusEbuildDependencyTestCase): +class DependTest(EbuildDependencyTestCase): """ DEPEND fulfilling test. """ depend_classes = [EbuildToucher] def __init__(self, *args, **kwargs): - DBusEbuildDependencyTestCase.__init__(self, *args, **kwargs) + EbuildDependencyTestCase.__init__(self, *args, **kwargs) self.phase_funcs['src_compile'].append( 'pms-test-suite-%s || die' % self.dependant_ebuilds[0].pv ) -class RDependTest(DBusEbuildDependencyTestCase): +class RDependTest(EbuildDependencyTestCase): """ RDEPEND fulfilling test. """ rdepend_classes = [EbuildToucher] def __init__(self, *args, **kwargs): - DBusEbuildDependencyTestCase.__init__(self, *args, **kwargs) + EbuildDependencyTestCase.__init__(self, *args, **kwargs) self.phase_funcs['pkg_postinst'].append( 'pms-test-suite-%s || die' % self.dependant_ebuilds[0].pv ) -class PDependTest(DBusEbuildDependencyTestCase): +class PDependTest(EbuildDependencyTestCase): """ PDEPEND fulfilling test. """ pdepend_classes = [EbuildToucher] def __init__(self, *args, **kwargs): - DBusEbuildDependencyTestCase.__init__(self, *args, **kwargs) + EbuildDependencyTestCase.__init__(self, *args, **kwargs) self.phase_funcs['pkg_postinst'].extend([ 'pms-test-suite-%s' % self.dependant_ebuilds[0].pv, 'pms-test_dbus_append_result ${?}' ]) def check_dbus_result(self, output, pm): - DBusEbuildDependencyTestCase.check_dbus_result(self, output, pm) - try: res = output[0] == '0' except IndexError: @@ -49,13 +47,13 @@ class PDependTest(DBusEbuildDependencyTestCase): self.assertFalse(res, 'PDEP merged before ebuild', undefined = True) -class FailingDependTest(DBusEbuildDependencyTestCase): +class FailingDependTest(EbuildDependencyTestCase): """ Unfulfilled DEPEND test. """ depend_classes = [FailingEbuild] expect_failure = True -class FailingRDependTest(DBusEbuildDependencyTestCase): +class FailingRDependTest(EbuildDependencyTestCase): """ Unfulfilled RDEPEND test. """ depend_classes = [FailingEbuild] diff --git a/pmstestsuite/library/standard/deprecated_vars.py b/pmstestsuite/library/standard/deprecated_vars.py index 14d1bd6..a4a4a6b 100644 --- a/pmstestsuite/library/standard/deprecated_vars.py +++ b/pmstestsuite/library/standard/deprecated_vars.py @@ -4,10 +4,10 @@ import os.path -from .dbus_case import DBusEbuildTestCase -from .ext_cases import DBusFetchingEbuildTestCase +from pmstestsuite.library.case import EbuildTestCase +from .ext_cases import FetchingEbuildTestCase -class AATest(DBusFetchingEbuildTestCase): +class AATest(FetchingEbuildTestCase): """ Test whether AA is declared. """ supported_eapis = (range(0, 4), (4,)) @@ -21,7 +21,7 @@ class AATest(DBusFetchingEbuildTestCase): } def __init__(self, *args, **kwargs): - DBusFetchingEbuildTestCase.__init__(self, *args, **kwargs) + FetchingEbuildTestCase.__init__(self, *args, **kwargs) self._expect_fn = os.path.split(self.ebuild_vars['SRC_URI'])[1] self.ebuild_vars['SRC_URI'] = 'pms_tests_magical_hidden_use? ( %s )' \ % self.ebuild_vars['SRC_URI'] @@ -32,10 +32,9 @@ class AATest(DBusFetchingEbuildTestCase): else: expect = '' - DBusEbuildTestCase.check_dbus_result(self, output, pm) self.assertEqual(output[0], expect, '${AA}') -class KVTest(DBusEbuildTestCase): +class KVTest(EbuildTestCase): """ Test whether KV is declared. """ supported_eapis = (range(0, 4), (4,)) @@ -46,7 +45,6 @@ class KVTest(DBusEbuildTestCase): } def check_dbus_result(self, output, pm): - DBusEbuildTestCase.check_dbus_result(self, output, pm) func = self.assertEqual if self.eapi == 4 \ else self.assertNotEqual func(output[0], '', '${KV}') diff --git a/pmstestsuite/library/standard/doins_fail.py b/pmstestsuite/library/standard/doins_fail.py index a965377..0088fe6 100644 --- a/pmstestsuite/library/standard/doins_fail.py +++ b/pmstestsuite/library/standard/doins_fail.py @@ -2,9 +2,9 @@ # (c) 2011 Michał Górny # Released under the terms of the 2-clause BSD license. -from .dbus_case import DBusEbuildTestCase +from pmstestsuite.library.case import EbuildTestCase -class DoInsFailureTest(DBusEbuildTestCase): +class DoInsFailureTest(EbuildTestCase): """ doins() failure handling test. """ supported_eapis = (range(0, 4), (4,)) @@ -17,5 +17,5 @@ class DoInsFailureTest(DBusEbuildTestCase): } def __init__(self, *args, **kwargs): - DBusEbuildTestCase.__init__(self, *args, **kwargs) + EbuildTestCase.__init__(self, *args, **kwargs) self.expect_failure = (self.eapi == 4) diff --git a/pmstestsuite/library/standard/eclass_depend.py b/pmstestsuite/library/standard/eclass_depend.py index 8812fb0..8f98ca5 100644 --- a/pmstestsuite/library/standard/eclass_depend.py +++ b/pmstestsuite/library/standard/eclass_depend.py @@ -2,10 +2,10 @@ # (c) 2011 Michał Górny # Released under the terms of the 2-clause BSD license. -from .dbus_case import DBusEclassDependencyTestCase +from pmstestsuite.library.case import EbuildTestCase from .util import EbuildToucher -class DependInheritanceTest(DBusEclassDependencyTestCase): +class DependInheritanceTest(EclassDependencyTestCase): """ DEPEND variable inheritance test. """ depend_classes = [EbuildToucher] @@ -13,13 +13,13 @@ class DependInheritanceTest(DBusEclassDependencyTestCase): eclass_contents = '' def __init__(self, *args, **kwargs): - DBusEclassDependencyTestCase.__init__(self, *args, **kwargs) + EclassDependencyTestCase.__init__(self, *args, **kwargs) self.phase_funcs['src_compile'].extend(( 'pms-test-suite-%s || die' % self.dependant_ebuilds[0].pv, 'pms-test-suite-%s || die' % self.dependant_ebuilds[1].pv )) -class RDependInheritanceTest(DBusEclassDependencyTestCase): +class RDependInheritanceTest(EclassDependencyTestCase): """ RDEPEND variable inheritance test. """ rdepend_classes = [EbuildToucher] @@ -27,13 +27,13 @@ class RDependInheritanceTest(DBusEclassDependencyTestCase): eclass_contents = '' def __init__(self, *args, **kwargs): - DBusEclassDependencyTestCase.__init__(self, *args, **kwargs) + EclassDependencyTestCase.__init__(self, *args, **kwargs) self.phase_funcs['pkg_postinst'].extend(( 'pms-test-suite-%s || die' % self.dependant_ebuilds[0].pv, 'pms-test-suite-%s || die' % self.dependant_ebuilds[1].pv )) -class PDependInheritanceTest(DBusEclassDependencyTestCase): +class PDependInheritanceTest(EclassDependencyTestCase): """ PDEPEND variable inheritance test. """ pdepend_classes = [EbuildToucher] diff --git a/pmstestsuite/library/standard/eclass_metadata.py b/pmstestsuite/library/standard/eclass_metadata.py index d7b6cf6..18a4686 100644 --- a/pmstestsuite/library/standard/eclass_metadata.py +++ b/pmstestsuite/library/standard/eclass_metadata.py @@ -4,9 +4,9 @@ from abc import abstractproperty -from .dbus_case import DBusEclassTestCase +from pmstestsuite.library.case import EclassTestCase -class VariableInheritanceTest(DBusEclassTestCase): +class VariableInheritanceTest(EclassTestCase): """ Eclass variable inheritance test. """ @abstractproperty @@ -29,7 +29,7 @@ class VariableInheritanceTest(DBusEclassTestCase): return '%s=%s\n' % (self.var_name, repr(self.var_eclass_value)) def __init__(self, *args, **kwargs): - DBusEclassTestCase.__init__(self, *args, **kwargs) + EclassTestCase.__init__(self, *args, **kwargs) self.ebuild_vars[self.var_name] = self.var_ebuild_value class IUseInheritanceTest(VariableInheritanceTest): @@ -40,16 +40,13 @@ class IUseInheritanceTest(VariableInheritanceTest): var_ebuild_value = 'bar' def check_dbus_result(self, output, pm): - # ensure it got installed first - DBusEclassTestCase.check_dbus_result(self, output, pm) - spl = pm.installed[self.atom(pm)].use self.assertContains(self.var_eclass_value, spl, 'IUSE (eclass)') self.assertContains(self.var_ebuild_value, spl, 'IUSE (ebuild)') # XXX: REQUIRED_USE -class EclassDefinedPhasesTest(DBusEclassTestCase): +class EclassDefinedPhasesTest(EclassTestCase): """ Check whether eclasses set DEFINED_PHASES as well. """ supported_eapis = ((4,),) @@ -70,8 +67,6 @@ EXPORT_FUNCTIONS src_compile ''' % self.pn def check_dbus_result(self, output, pm): - DBusEclassTestCase.check_dbus_result(self, output, pm) - phases = pm.installed[self.atom(pm)].defined_phases self.assertContains('compile', phases, 'DEFINED_PHASES (eclass)') self.assertContains('install', phases, 'DEFINED_PHASES (ebuild)') diff --git a/pmstestsuite/library/standard/ext_cases.py b/pmstestsuite/library/standard/ext_cases.py index 94a93cc..8fcbf12 100644 --- a/pmstestsuite/library/standard/ext_cases.py +++ b/pmstestsuite/library/standard/ext_cases.py @@ -2,16 +2,16 @@ # (c) 2011 Michał Górny # Released under the terms of the 2-clause BSD license. -from .dbus_case import DBusEbuildTestCase +from pmstestsuite.library.case import EbuildTestCase -class DBusFetchingEbuildTestCase(DBusEbuildTestCase): +class FetchingEbuildTestCase(EbuildTestCase): """ - A DBusEbuildTestCase variant with a standarized way of fetching + A EbuildTestCase variant with a standarized way of fetching sources -- to decrease {${DISTDIR}} pollution. """ def __init__(self, *args, **kwargs): - DBusEbuildTestCase.__init__(self, *args, **kwargs) + EbuildTestCase.__init__(self, *args, **kwargs) val = 'http://dev.gentoo.org/~mgorny/pmsts-temp.bin' if 'SRC_URI' in self.ebuild_vars: val = '%s %s' % (self.ebuild_vars['SRC_URI'], val) diff --git a/pmstestsuite/library/standard/phase_function_order.py b/pmstestsuite/library/standard/phase_function_order.py index a9f24ac..12a2234 100644 --- a/pmstestsuite/library/standard/phase_function_order.py +++ b/pmstestsuite/library/standard/phase_function_order.py @@ -2,15 +2,15 @@ # (c) 2011-2012 Michał Górny # Released under the terms of the 2-clause BSD license. -from .dbus_case import DBusEbuildTestCase +from pmstestsuite.library.case import EbuildTestCase -class PhaseFunctionOrderTest(DBusEbuildTestCase): +class PhaseFunctionOrderTest(EbuildTestCase): """ Phase function execution order test. """ supported_eapis = ((0, 1), (2, 3), (4,)) def __init__(self, *args, **kwargs): - DBusEbuildTestCase.__init__(self, *args, **kwargs) + EbuildTestCase.__init__(self, *args, **kwargs) for k, lines in self.phase_funcs.items(): lines.append('pms-test_dbus_append_result %s' % k) @@ -24,5 +24,4 @@ class PhaseFunctionOrderTest(DBusEbuildTestCase): expect.extend(['src_prepare', 'src_configure']) expect.extend(['src_compile', 'src_install', 'pkg_preinst', 'pkg_postinst']) - DBusEbuildTestCase.check_dbus_result(self, output, pm) self.assertEqual(output, expect, 'Executed phases') diff --git a/pmstestsuite/library/standard/special_vars.py b/pmstestsuite/library/standard/special_vars.py index 8283a60..acbfd32 100644 --- a/pmstestsuite/library/standard/special_vars.py +++ b/pmstestsuite/library/standard/special_vars.py @@ -2,9 +2,9 @@ # (c) 2011-2012 Michał Górny # Released under the terms of the 2-clause BSD license. -from .dbus_case import DBusEbuildTestCase +from pmstestsuite.library.case import EbuildTestCase -class InheritedVariableTest(DBusEbuildTestCase): +class InheritedVariableTest(EbuildTestCase): """ INHERITED variable definition test. """ phase_funcs = { @@ -14,11 +14,10 @@ class InheritedVariableTest(DBusEbuildTestCase): } def check_dbus_result(self, output, pm): - DBusEbuildTestCase.check_dbus_result(self, output, pm) inherits = output[0].split() self.assertContains('pms-test', inherits, 'INHERITED') -class RDependFallbackTest(DBusEbuildTestCase): +class RDependFallbackTest(EbuildTestCase): """ Test whether RDEPEND=${DEPEND} fallback works as expected. """ supported_eapis = (range(0, 4), (4,)) @@ -28,8 +27,6 @@ class RDependFallbackTest(DBusEbuildTestCase): } def check_dbus_result(self, output, pm): - DBusEbuildTestCase.check_dbus_result(self, output, pm) - class DepMatcher(object): def __eq__(self, other): return other.key == str(self) @@ -50,7 +47,7 @@ class RDependFallbackTest(DBusEbuildTestCase): else: self.assertContains(mydep, rdep, 'RDEPEND') -class DefinedPhasesTest(DBusEbuildTestCase): +class DefinedPhasesTest(EbuildTestCase): """ Test whether DEFINED_PHASES are declared in EAPI 4. """ supported_eapis = ((4,),) @@ -61,7 +58,5 @@ class DefinedPhasesTest(DBusEbuildTestCase): } def check_dbus_result(self, output, pm): - DBusEbuildTestCase.check_dbus_result(self, output, pm) - phases = pm.installed[self.atom(pm)].defined_phases self.assertEqual(tuple(phases), ('setup',), 'DEFINED_PHASES') diff --git a/pmstestsuite/library/standard/util.py b/pmstestsuite/library/standard/util.py index 0bee1b5..37e44f8 100644 --- a/pmstestsuite/library/standard/util.py +++ b/pmstestsuite/library/standard/util.py @@ -2,9 +2,9 @@ # (c) 2011 Michał Górny # Released under the terms of the 2-clause BSD license. -from .dbus_case import DBusEbuildTestCase +from pmstestsuite.library.case import EbuildTestCase -class EbuildToucher(DBusEbuildTestCase): +class EbuildToucher(EbuildTestCase): """ Touched file installer (for dependency tests). """ @property @@ -12,7 +12,7 @@ class EbuildToucher(DBusEbuildTestCase): return id(self) def __init__(self, *args, **kwargs): - DBusEbuildTestCase.__init__(self, *args, **kwargs) + EbuildTestCase.__init__(self, *args, **kwargs) self.phase_funcs['src_unpack'].append( '''cat >> mytrue.sh <<_EOF_ #!/bin/sh @@ -23,7 +23,7 @@ _EOF_''' 'newbin mytrue.sh pms-test-suite-%s || die' % self.pv ) -class FailingEbuild(DBusEbuildTestCase): +class FailingEbuild(EbuildTestCase): """ A failing ebuild. """ phase_funcs = { diff --git a/pmstestsuite/library/standard/variable_scope.py b/pmstestsuite/library/standard/variable_scope.py index bee1d7e..614f6ee 100644 --- a/pmstestsuite/library/standard/variable_scope.py +++ b/pmstestsuite/library/standard/variable_scope.py @@ -4,9 +4,9 @@ import re -from .dbus_case import DBusEbuildTestCase +from pmstestsuite.library.case import EbuildTestCase -class VariableScopeTest(DBusEbuildTestCase): +class VariableScopeTest(EbuildTestCase): """ A test for scoping of variables. """ ebuild_vars = { @@ -70,5 +70,3 @@ class VariableScopeTest(DBusEbuildTestCase): for var, regexp in zip(output, matches): self.assertEqual(var, regexp, regexp.name) - - return DBusEbuildTestCase.check_dbus_result(self, output, pm) diff --git a/pmstestsuite/library/standard/workdir_fallback.py b/pmstestsuite/library/standard/workdir_fallback.py index 04ce281..6416ac6 100644 --- a/pmstestsuite/library/standard/workdir_fallback.py +++ b/pmstestsuite/library/standard/workdir_fallback.py @@ -2,9 +2,9 @@ # (c) 2011 Michał Górny # Released under the terms of the 2-clause BSD license. -from .ext_cases import DBusFetchingEbuildTestCase +from .ext_cases import FetchingEbuildTestCase -class WorkdirFallbackTest(DBusFetchingEbuildTestCase): +class WorkdirFallbackTest(FetchingEbuildTestCase): """ S=${WORKDIR} fallback test. """ supported_eapis = (range(0, 4), (4,)) @@ -27,5 +27,5 @@ class WorkdirFallbackTest(DBusFetchingEbuildTestCase): } def __init__(self, *args, **kwargs): - DBusFetchingEbuildTestCase.__init__(self, *args, **kwargs) + FetchingEbuildTestCase.__init__(self, *args, **kwargs) self.expect_failure = (self.eapi == 4) -- cgit v1.2.3-65-gdbad