[z3-checkins] r10886 - z3/Five/branch/philikon-restructuring/tests

philikon at codespeak.net philikon at codespeak.net
Tue Apr 19 23:56:19 MEST 2005


Author: philikon
Date: Tue Apr 19 23:56:19 2005
New Revision: 10886

Removed:
   z3/Five/branch/philikon-restructuring/tests/fivetest.py
   z3/Five/branch/philikon-restructuring/tests/zopeconf.py
Log:
get rid of unnecessary complication


Deleted: /z3/Five/branch/philikon-restructuring/tests/fivetest.py
==============================================================================
--- /z3/Five/branch/philikon-restructuring/tests/fivetest.py	Tue Apr 19 23:56:19 2005
+++ (empty file)
@@ -1,49 +0,0 @@
-
-# ZopeTestCase was not designed to run tests as part of the
-# Zope test suite proper. In particular, it intercepts product
-# installation. We have to work around this for the Five tests
-# by starting up Zope2 before doing anything else.
-#
-# Note: fivetest must be imported first thing by test modules!
-
-def _part_of_zope_suite():
-    # Find out if we run from softwarehome
-    from os.path import normcase, realpath
-    from App.config import getConfiguration
-    softwarehome = normcase(realpath(getConfiguration().softwarehome))
-    return normcase(realpath(__file__)).startswith(softwarehome)
-
-def _start_zope():
-    # Startup Zope 2.7 or 2.8+
-    import Testing
-    try:
-        import Zope2 as Zope
-    except ImportError:
-        import Zope
-    Zope.startup()
-
-def _load_test_config():
-    # Load up the ZCML config for the FiveTest product
-    from os.path import dirname, join
-    from Products.Five import zcml
-    from Products.Five.tests.products import FiveTest
-    prefix = dirname(FiveTest.__file__)
-    zcml.load_config(join(prefix, 'testing.zcml'), FiveTest)
-
-def _main():
-    if _part_of_zope_suite():
-        _start_zope()
-    else:
-        from Testing.ZopeTestCase import installProduct
-        installProduct('Five')
-        installProduct('PythonScripts')
-    _load_test_config()
-
-_main()
-
-
-from Testing.ZopeTestCase import *
-
-class FiveTestCase(ZopeTestCase):
-    pass
-

Deleted: /z3/Five/branch/philikon-restructuring/tests/zopeconf.py
==============================================================================
--- /z3/Five/branch/philikon-restructuring/tests/zopeconf.py	Tue Apr 19 23:56:19 2005
+++ (empty file)
@@ -1,26 +0,0 @@
-import os
-from os.path import join, abspath, dirname, split, exists
-
-
-def process():
-    """Read in zope.conf configuration file.
-
-    This is a hack but there doesn't seem to be a better way.
-    """
-    _prefix = os.environ.get('INSTANCE_HOME')
-    if not _prefix:
-        try:
-            __file__
-        except NameError:
-            # Test was called directly, so no __file__ global exists.
-            _prefix = abspath(os.curdir)
-        else:
-            # Test was called by another test.
-            _prefix = abspath(dirname(__file__))
-        _prefix = join(_prefix, '..', '..', '..')
-
-    _config = join(_prefix, 'etc', 'zope.conf')
-
-    if exists(_config):
-        from Zope import configure
-        configure(_config)


More information about the z3-checkins mailing list