Beispiel #1
0
##############################################################################
"""Testing for z3c.etestbrowser

$Id$
"""

from zope.app.testing import functional
import doctest
import os.path
import unittest
import z3c.etestbrowser
import zope.app.wsgi.testlayer

layer = functional.ZCMLLayer(os.path.join(
    os.path.split(__file__)[0], 'ftesting.zcml'),
                             __name__,
                             'ETestBrowserLayer',
                             allow_teardown=True)

wsgi_layer = zope.app.wsgi.testlayer.BrowserLayer(z3c.etestbrowser,
                                                  allowTearDown=True)


def setUpWSGI(test):
    test.globs['wsgi_app'] = wsgi_layer.make_wsgi_app()


def test_suite():
    suite = unittest.TestSuite()

    test = functional.FunctionalDocFileSuite("README.txt",
Beispiel #2
0
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Registration functional tests
"""
from zope import interface
from zope.app.component.testing import AppComponentLayer
from zope.app.testing import functional
import doctest
import os.path
import unittest
import zope.app.testing.functional

AppComponentBrowserLayer = functional.ZCMLLayer(os.path.join(
    os.path.dirname(__file__), 'ftesting.zcml'),
                                                __name__,
                                                'AppComponentBrowserLayer',
                                                allow_teardown=True)


class ISampleBase(interface.Interface):
    pass


class ISample(ISampleBase):
    pass


class Sample:
    interface.implements(ISample)
Beispiel #3
0
import os
import unittest

from zope.testing import doctest
from zope.app.testing.functional import FunctionalTestSetup, getRootFolder
from zope.app.testing import functional

ftesting_zcml = os.path.join(os.path.dirname(__file__), 'ftesting.zcml')
TestLayer = functional.ZCMLLayer(ftesting_zcml, __name__, 'TestLayer')

optionflags = doctest.NORMALIZE_WHITESPACE + doctest.ELLIPSIS
globs = dict(getRootFolder=getRootFolder)


def setUp(test):
    FunctionalTestSetup().setUp()


def tearDown(test):
    FunctionalTestSetup().tearDown()


def test_suite():
    suite = unittest.TestSuite()
    dottedname = 'mars.contentprovider.ftests.contentprovider'
    test = doctest.DocTestSuite(dottedname,
                                setUp=setUp,
                                extraglobs=globs,
                                tearDown=tearDown,
                                optionflags=optionflags)
    test.layer = TestLayer
Beispiel #4
0
import os
import unittest

from zope.testing import doctest
from zope.app.testing import functional

minimal_zcml = os.path.join(os.path.dirname(__file__), 'minimal-ftesting.zcml')
TestMinimalLayer = functional.ZCMLLayer(minimal_zcml, __name__,
                                        'TestMinimalLayer')
pagelet_zcml = os.path.join(os.path.dirname(__file__), 'pagelet-ftesting.zcml')
TestPageletLayer = functional.ZCMLLayer(pagelet_zcml, __name__,
                                        'TestPageletLayer')

optionflags = doctest.NORMALIZE_WHITESPACE + doctest.ELLIPSIS


def setUp(test):
    functional.FunctionalTestSetup().setUp()


def tearDown(test):
    functional.FunctionalTestSetup().tearDown()


def test_suite():
    suite = unittest.TestSuite()
    dottedname = 'mars.layer.ftests.%s'
    for name in ['minimal', 'directive']:
        test = doctest.DocTestSuite(dottedname % name,
                                    setUp=setUp,
                                    tearDown=tearDown,
Beispiel #5
0
from zojax.authentication.credentials import factory as defaultCreds
from zojax.catalog.catalog import Catalog, ICatalog
from zojax.content.type.interfaces import IItem
from zojax.content.type.item import PersistentItem
from zojax.layoutform.interfaces import ILayoutFormLayer
from zojax.ownership.interfaces import IOwnership
from zojax.personal.space.manager import PersonalSpaceManager, IPersonalSpaceManager


class IDefaultSkin(ILayoutFormLayer, Rotterdam):
    """ skin """


AcknowledgementLayer = functional.ZCMLLayer(os.path.join(
    os.path.split(__file__)[0], 'ftesting.zcml'),
                                            __name__,
                                            'AcknowledgementLayer',
                                            allow_teardown=True)


class IContent(IItem):
    """ content """


class Content(PersistentItem):
    interface.implements(IContent)


def FunctionalDocFileSuite(*paths, **kw):
    layer = AcknowledgementLayer
Beispiel #6
0
    """
    If a response body is not html, guess that it is text/plain.  This
    follows the behavior of zope.publication's trunk as of this writing.

    >>> import zc.resourcelibrary.publication
    >>> response = zc.resourcelibrary.publication.Response()
    >>> response.setResult('')
    >>> response.getHeader('content-type')
    'text/plain'
    """


#### test setup ####

ResourceLibraryFunctionalLayer = functional.ZCMLLayer(
    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'), __name__,
    'ResourceLibraryFunctionalLayer')


def test_suite():
    suite = functional.FunctionalDocFileSuite(
        '../README.txt',
        'duplicate_declarations.txt',
        'localsite.txt',
        globs={
            'zcml': zcml,
            'zpt': zpt
        },
        optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
    )
    suite.layer = ResourceLibraryFunctionalLayer