Skip to content

Commit

Permalink
Allow the fucntional nodevmode testing layer to be used from instances
Browse files Browse the repository at this point in the history
as well.  That means the zopeskel files also needed a non-devmode
ftesting.zcml (called ftesting-base.zcml) and the necessary file path
manipulation was needed in zope.app.testing.functional.
  • Loading branch information
philikon committed Aug 18, 2006
1 parent a7a1564 commit 949b983
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,24 @@ def defineLayer(name, zcml='test.zcml'):

if os.path.exists(os.path.join('zopeskel', 'etc', 'ftesting.zcml')):
Functional = os.path.join('zopeskel', 'etc', 'ftesting.zcml')
FunctionalNoDevMode = os.path.join('zopeskel', 'etc', 'ftesting-base.zcml')
elif os.path.exists(os.path.join('etc', 'ftesting.zcml')):
Functional = os.path.join('etc', 'ftesting.zcml')
FunctionalNoDevMode = os.path.join('etc', 'ftesting-base.zcml')
else:
# let's hope that the file is in our CWD. If not, we'll get an
# error anyways, but we can't just throw an error if we don't find
# that file. This module might be imported for other things as
# well, not only starting up Zope from ftesting.zcml.
Functional = 'ftesting.zcml'
FunctionalNoDevMode = 'ftesting-base.zcml'

Functional = os.path.abspath(Functional)
FunctionalNoDevMode = os.path.abspath(FunctionalNoDevMode)

Functional = ZCMLLayer(
Functional, __name__, 'Functional')
Functional = ZCMLLayer(Functional, __name__, 'Functional')
FunctionalNoDevMode = ZCMLLayer(FunctionalNoDevMode, __name__,
'FunctionalNoDevMode')

class FunctionalTestCase(unittest.TestCase):
"""Functional test case."""
Expand Down

0 comments on commit 949b983

Please sign in to comment.