当前位置: 首页>>代码示例>>Python>>正文


Python TestSuite.addTest方法代码示例

本文整理汇总了Python中unittest.TestSuite.addTest方法的典型用法代码示例。如果您正苦于以下问题:Python TestSuite.addTest方法的具体用法?Python TestSuite.addTest怎么用?Python TestSuite.addTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在unittest.TestSuite的用法示例。


在下文中一共展示了TestSuite.addTest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def test_suite():
    from unittest import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(TestValidity))    
    
    return suite
                                               
开发者ID:Easyshop,项目名称:Easyshop,代码行数:8,代码来源:test_adapter_criteria.py

示例2: test_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def test_suite():
    from unittest import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(TestTutorialPageComments))
    if MockMailHost:
        suite.addTest(makeSuite(MockMailHostTests))
    return suite
开发者ID:chy-causer,项目名称:Products.PloneHelpCenter,代码行数:9,代码来源:testComments.py

示例3: test_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def test_suite():
    from unittest import TestSuite, makeSuite

    suite = TestSuite()
    suite.addTest(makeSuite(TestSSOLogin))
    suite.addTest(makeSuite(TestSSOLoginIframe))
    return suite
开发者ID:rochecompaan,项目名称:Products.CMFPlone,代码行数:9,代码来源:testSSOLogin.py

示例4: loadTestsFromModules

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
    def loadTestsFromModules(self, testCaseModules):
        suite = TestSuite()
        for testCaseModule in testCaseModules:
            subSuite = self.loader.loadTestsFromModule(testCaseModule)
            suite.addTest(subSuite)

        return suite
开发者ID:FatherAbraham1,项目名称:hurricane-book-case_SourceCode-,代码行数:9,代码来源:runtest.py

示例5: test_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def test_suite():
    from unittest import TestSuite, makeSuite

    suite = TestSuite()
    suite.addTest(makeSuite(TestPortlet))
    suite.addTest(makeSuite(TestRenderer))
    return suite
开发者ID:mingtak,项目名称:nnsh.portlet.subfolderlist,代码行数:9,代码来源:test_portlet.py

示例6: test_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def test_suite():
    from unittest import TestSuite, makeSuite

    suite = TestSuite()
    suite.addTest(makeSuite(TestRuleManagementViews))
    suite.addTest(makeSuite(TestRuleElementManagementViews))
    return suite
开发者ID:pigaov10,项目名称:plone4.3,代码行数:9,代码来源:test_rule_management_views.py

示例7: test_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def test_suite():
    from unittest import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(TestInstallation))
    suite.addTest(makeSuite(TestUwoshgrantsProposal))

    return suite
开发者ID:Milstein,项目名称:uwosh.grants,代码行数:9,代码来源:testSetup.py

示例8: MobileDetectionFactory

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def MobileDetectionFactory(uas, expected):
    class MobileDetection(TestCase):

        def testUA(self, ua):
            app = DummyWSGI(ua)
            request = app.request
            mobiledetector.Middleware(app)
            if self.expected:
                self.assert_(request.mobile,
                             "Mobile Not Detected: %s" % ua)
            else:
                self.assert_(not request.mobile,
                             "Mobile Falsely Detected: %s" % ua)
    def testnum(num):
        def test(self):
            return self.testUA(self.uas[num])
        return test
    MobileDetection.uas = uas
    MobileDetection.expected = expected
    suite = TestSuite()
    for x in range(len(uas)):
        if not uas[x].startswith('#'):
            setattr(MobileDetection, 'test%s'%x, testnum(x))
            suite.addTest(MobileDetection('test%s' % x))
    return suite
开发者ID:lojack,项目名称:mobiledetector,代码行数:27,代码来源:__init__.py

示例9: test_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def test_suite():
    from unittest import TestSuite, makeSuite

    suite = TestSuite()
    suite.addTest(makeSuite(TestHTTPHeaders))

    return suite
开发者ID:pigaov10,项目名称:plone4.3,代码行数:9,代码来源:testHTTPHeaders.py

示例10: build_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
    def build_suite(self, test_labels, extra_tests=None, **kwargs):
        '''
        Override the base class method to return a suite consisting of all
        TestCase subclasses throughought the whole project.
        '''
        if test_labels:
            suite = TestSuite()
        else:
            suite = DjangoTestSuiteRunner.build_suite(
                self, test_labels, extra_tests, **kwargs
            )
        added_test_classes = set(t.__class__ for t in suite)

        loader = TestLoader()
        for fname in _get_module_names(os.getcwd()):
            module = _import(_to_importable_name(fname))
            for test_class in _get_testcases(module):

                if test_class in added_test_classes:
                    continue

                for method_name in loader.getTestCaseNames(test_class):
                    testname = '.'.join([
                        module.__name__, test_class.__name__, method_name
                    ])
                    if self._test_matches(testname, test_labels):
                        suite.addTest(loader.loadTestsFromName(testname))
                        added_test_classes.add(test_class)

        return reorder_suite(suite, (TestCase,))
开发者ID:bloodearnest,项目名称:extending_unittest,代码行数:32,代码来源:all_dirs_runner.py

示例11: test_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def test_suite():
    from unittest import TestSuite, makeSuite
    from Products.PloneTestCase.layer import ZCMLLayer
    suite = TestSuite()
    suite.layer = ZCMLLayer
    suite.addTest(makeSuite(TestCustomScript))
    return suite
开发者ID:sixfeetup,项目名称:Products.PloneFormGen,代码行数:9,代码来源:testSubmissionFolder.py

示例12: suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def suite():
    "Builds a test suite for the GIS package."
    s = TestSuite()
    for test_suite in test_suite_names:
        tsuite = getattr(__import__('django.contrib.gis.tests', globals(), locals(), [test_suite]),test_suite)
        s.addTest(tsuite.suite())
    return s
开发者ID:hfeeki,项目名称:geodjango,代码行数:9,代码来源:__init__.py

示例13: test_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def test_suite():
    from unittest import TestSuite, makeSuite
    suite = TestSuite()
    if have_photo:
        suite.addTest(makeSuite(TestPhoto))
        suite.addTest(makeSuite(TestPUTPhoto))
    return suite
开发者ID:eaudeweb,项目名称:naaya,代码行数:9,代码来源:testPhoto.py

示例14: test_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def test_suite():
    """ Test Suite
    """
    from unittest import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(TestHistory))
    return suite
开发者ID:zotya,项目名称:eea.workflow,代码行数:9,代码来源:test_history.py

示例15: test_suite

# 需要导入模块: from unittest import TestSuite [as 别名]
# 或者: from unittest.TestSuite import addTest [as 别名]
def test_suite():
    from unittest import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(MarscatsSettingsStorageXMLAdapterTests))
    suite.addTest(makeSuite(exportMarscatsSettingsStorageTests))
    suite.addTest(makeSuite(importMarscatsSettingsStorageTests))
    return suite
开发者ID:RBINS,项目名称:mars,代码行数:9,代码来源:test_exportimport.py


注:本文中的unittest.TestSuite.addTest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。