def suiteFromPackage(name):
    files = resource_listdir(__name__, name)
    suite = unittest.TestSuite()
    for filename in files:
        if not filename.endswith('.py'):
            continue
        if filename == '__init__.py':
            continue
        if filename[0] in ('.', '#'):
            # Some editor create temporary files which can be
            # annoying.
            continue

        dottedname = 'five.grok.ftests.%s.%s' % (name, filename[:-3])
        test = FunctionalDocTestSuite(
            dottedname,
            extraglobs=dict(getRootFolder=getRootFolder,
                            sync=sync),
            optionflags=(doctest.ELLIPSIS+
                         doctest.NORMALIZE_WHITESPACE+
                         doctest.REPORT_NDIFF))
        test.layer = FunctionalLayer

        suite.addTest(test)
    return suite
Exemple #2
0
def test_suite():
    suite = unittest.TestSuite()

    for name in ['adapters', 'annotation', 'multiadapter', 'utilities',
                 'subscribers']:
        test = FunctionalDocTestSuite(
            module='five.grok.tests.%s' % name,
            optionflags=options)
        test.layer = FunctionalLayer
        suite.addTest(test)
    return suite
def suiteFromPackage(name):
    files = resource_listdir(__name__, name)
    suite = unittest.TestSuite()
    for filename in files:
        if not filename.endswith('.py'):
            continue
        if filename == '__init__.py':
            continue

        dottedname = 'five.megrok.z3cpt.ftests.%s.%s' % (name, filename[:-3])
        test = FunctionalDocTestSuite(
            dottedname,
            extraglobs=dict(http=HTTPCaller(),
                            http_call=http_call,
                            getRootFolder=getRootFolder,
                            sync=sync),
            optionflags=(doctest.ELLIPSIS + doctest.NORMALIZE_WHITESPACE +
                         doctest.REPORT_NDIFF))
        test.layer = GrokFunctionalLayer

        suite.addTest(test)
    return suite
def test_suite():
    import unittest
    from Testing.ZopeTestCase import FunctionalDocTestSuite
    from Testing.ZopeTestCase import FunctionalDocFileSuite
    from Products.PloneTestCase.PloneTestCase import FunctionalTestCase
    # XXX 'digest' tests need to be first, b/c they depend on some
    # traversal adapter registrations that won't exist once the CA
    # registration is torn down in the tearDown function
    all_tests = unittest.TestSuite((
        FunctionalDocTestSuite('Products.listen.content.digest',
                               setUp=setup_utility,
                               tearDown=tearDown,
                               test_class=FunctionalTestCase,
                               optionflags=optionflags),
        FunctionalDocTestSuite('Products.listen.content.mailinglist',
                               setUp=setup_listen_components,
                               tearDown=tearDown,
                               test_class=FunctionalTestCase),
        FunctionalDocTestSuite('Products.listen.content.subscriptions',
                               setUp=setup_utility,
                               tearDown=tearDown,
                               test_class=FunctionalTestCase,
                               optionflags=optionflags),
        FunctionalDocTestSuite('Products.listen.content.membership_handlers',
                               setUp=setup_utility,
                               tearDown=tearDown,
                               test_class=FunctionalTestCase),
        FunctionalDocTestSuite('Products.listen.content.membership_policies',
                               setUp=setup_utility,
                               tearDown=tearDown,
                               test_class=FunctionalTestCase),
        FunctionalDocTestSuite('Products.listen.content.send_mail',
                               setUp=setup_utility,
                               tearDown=tearDown,
                               test_class=FunctionalTestCase),
        FunctionalDocTestSuite('Products.listen.content.post_policies',
                               setUp=setup_utility,
                               tearDown=tearDown,
                               test_class=FunctionalTestCase),
        FunctionalDocFileSuite(
            'mailboxer_list.txt',
            package="Products.listen.content.mailboxer_list",
            setUp=setup_logging,
            tearDown=teardown_logging),
    ))
    return all_tests
Exemple #5
0
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestTraverse))
    from Testing.ZopeTestCase import FunctionalDocTestSuite
    suite.addTest(FunctionalDocTestSuite())
    return suite
Exemple #6
0
def test_suite():
    # Must use functional because registerPackage commits
    from Testing.ZopeTestCase import FunctionalDocTestSuite
    return FunctionalDocTestSuite()
Exemple #7
0
def test_suite():
    from Testing.ZopeTestCase import FunctionalDocTestSuite
    return FunctionalDocTestSuite()
def test_suite():
    from Testing.ZopeTestCase import FunctionalDocTestSuite
    from doctest import ELLIPSIS
    return FunctionalDocTestSuite(optionflags=ELLIPSIS)
def test_suite():
    return TestSuite((
        FunctionalDocTestSuite(setUp=setUp),
        FunctionalDocFileSuite('FunctionalDocTest.txt', setUp=setUp),
    ))
def test_suite():
    return unittest.TestSuite((
        unittest.makeSuite(HTTPHeaderOutputTests),
        FunctionalDocTestSuite(setUp=setUp),
        FunctionalDocFileSuite('FunctionalDocTest.txt', setUp=setUp),
    ))
Exemple #11
0
def test_suite():
    return unittest.TestSuite((FunctionalDocTestSuite(), ))
def test_suite():
    from Testing.ZopeTestCase import FunctionalDocTestSuite
    import doctest
    return FunctionalDocTestSuite(optionflags=doctest.ELLIPSIS
                                  | doctest.NORMALIZE_WHITESPACE)