Commit 249117a8 authored by Stefan H. Holek's avatar Stefan H. Holek

Add copyright headers and bump version.

parent db5ddbe9
"""Test runner that works with zope.testing.testrunner""" ##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Test runner that works with zope.testing.testrunner
$Id"
"""
import unittest import unittest
import os import os
......
...@@ -3,3 +3,4 @@ variable ...@@ -3,3 +3,4 @@ variable
>>> getattr(self.app, 'LAYER_EXTRACTED', False) >>> getattr(self.app, 'LAYER_EXTRACTED', False)
True True
from Testing.ZopeTestCase import ZopeDocFileSuite as FileSuite ##############################################################################
from Testing.ZopeTestCase import ZopeDocTestSuite as TestSuite #
from Testing.ZopeTestCase.ZopeTestCase import ZopeTestCase # Copyright (c) 2006 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Test layer extraction feature
$Id$
"""
from unittest import TestSuite
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Testing.ZopeTestCase import ZopeDocFileSuite
from Testing.ZopeTestCase import ZopeDocTestSuite
from Testing.ZopeTestCase import transaction
import transaction as txn
class TestLayer: class TestLayer:
""" """
...@@ -13,30 +30,29 @@ class TestLayer: ...@@ -13,30 +30,29 @@ class TestLayer:
>>> getattr(self.app, 'LAYER_EXTRACTED', False) >>> getattr(self.app, 'LAYER_EXTRACTED', False)
True True
""" """
@classmethod @classmethod
def setUp(cls): def setUp(cls):
app = ZopeTestCase.app() app = ZopeTestCase.app()
app.LAYER_EXTRACTED = True app.LAYER_EXTRACTED = True
txn.commit() transaction.commit()
ZopeTestCase.close(app) ZopeTestCase.close(app)
@classmethod @classmethod
def tearDown(cls): def tearDown(cls):
app = ZopeTestCase.app() app = ZopeTestCase.app()
del app.LAYER_EXTRACTED delattr(app, 'LAYER_EXTRACTED')
txn.commit() transaction.commit()
ZopeTestCase.close(app) ZopeTestCase.close(app)
class TestCase(ZopeTestCase.ZopeTestCase): class TestCase(ZopeTestCase.ZopeTestCase):
layer = TestLayer layer = TestLayer
def test_suite(): def test_suite():
import unittest return TestSuite((
fs = FileSuite('layerextraction.txt', ZopeDocTestSuite(test_class=TestCase),
test_class=TestCase, ZopeDocFileSuite('layerextraction.txt', test_class=TestCase),
package='Testing.ZopeTestCase.zopedoctest' ))
)
ts = TestSuite('Testing.ZopeTestCase.zopedoctest.test_layerextraction',
test_class=TestCase,
)
return unittest.TestSuite((fs, ts))
"""Test runner that works with zope.testing.testrunner""" ##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Test runner that works with zope.testing.testrunner
$Id$
"""
import unittest import unittest
import os import os
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment