• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python suite.TestSuite类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: load_tests

def load_tests(loader, standard_tests, pattern):
    suite = TestSuite()
    suite.addTest(DeactivateReactivateBlockStorage(
        'test_create_volume_from_deactivated_image_invalid'))
    suite.addTest(DeactivateReactivateBlockStorage(
        'test_create_volume_from_reactivated_image'))
    return suite
开发者ID:kshortwindham,项目名称:cloudroast,代码行数:7,代码来源:deactivate_reactivate_block_storage_test.py


示例2: load_tests

def load_tests(loader, tests, pattern):
    suite = TestSuite()
    suite.addTests(load_testsuite(loader, dirname(__file__)))
    # Numba CUDA tests are located in a separate directory:
    cuda_dir = join(dirname(dirname(__file__)), 'cuda/tests')
    suite.addTests(loader.discover(cuda_dir))
    return suite
开发者ID:Alexhuszagh,项目名称:numba,代码行数:7,代码来源:__init__.py


示例3: load_tests

def load_tests(loader, standard_tests, pattern):
    suite = TestSuite()
    suite.addTest(GlanceScrubberTest(
        "test_chunks_present_after_image_create"))
    suite.addTest(GlanceScrubberTest(
        "test_chunks_deleted_after_image_delete"))
    return suite
开发者ID:Prokop,项目名称:cloud_roast,代码行数:7,代码来源:test_glance_scrubber.py


示例4: load_tests

def load_tests(loader, standard_tests, pattern):
    suite = TestSuite()
    suite.addTest(ResizeServerVolumeIntegrationTest(
        "test_resize_server_and_confirm"))
    suite.addTest(ResizeServerVolumeIntegrationTest(
        "test_volume_attached_after_resize"))
    return suite
开发者ID:bhushan5,项目名称:cloudroast,代码行数:7,代码来源:test_resize_server_with_volume.py


示例5: load_tests

def load_tests(loader, standard_tests, pattern):
    suite = TestSuite()
    suite.addTest(MultipleContainersTest(
        "test_custom_container_present_after_image_create"))
    suite.addTest(MultipleContainersTest(
        "test_custom_container_present_after_image_delete"))
    return suite
开发者ID:bhushan5,项目名称:cloudroast,代码行数:7,代码来源:test_multiple_containers.py


示例6: load_tests_from_classes

def load_tests_from_classes(test_cases):
    suite = TestSuite()
    loader = TestLoader()
    for test_class in test_cases:
        tests = loader.loadTestsFromTestCase(test_class)
        suite.addTests(tests)
    return suite
开发者ID:orenlivne,项目名称:ober,代码行数:7,代码来源:test_util.py


示例7: load_tests

def load_tests(loader, standard_tests, pattern):
    suite = TestSuite()
    suite.addTest(CreateServerVolumeIntegrationTest(
        "test_attach_volume_to_server"))
    suite.addTest(CreateServerVolumeIntegrationTest(
        "test_format_and_mount_volume"))
    return suite
开发者ID:kshortwindham,项目名称:cloudroast,代码行数:7,代码来源:test_create_server_with_volume.py


示例8: load_tests

def load_tests(loader, standard_tests, pattern):
    suite = TestSuite()
    suite.addTest(VolumeServerIntegration(
        "test_can_create_volume_server_from_deactivated_image"))
    suite.addTest(VolumeServerIntegration(
        "test_can_create_volume_server_from_reactivated_image"))
    return suite
开发者ID:rcbops-qe,项目名称:cloudroast,代码行数:7,代码来源:deactivate_reactivate_bfv_test.py


示例9: runTest

 def runTest():
     suite = TestSuite()
     suite.addTest(self.test)
     runner = _TestRunner()
     result = runner.run(suite)
     if result.err is not None:
         desc = result.err[1].message + "\n" + "".join(traceback.format_tb(result.err[2]))
         raise Exception(desc)
开发者ID:elpaso,项目名称:qgis-tester-plugin,代码行数:8,代码来源:test.py


示例10: build_suite

    def build_suite(self, *args, **kwargs):
        suite = super(CustomizedRunner, self).build_suite(*args, **kwargs)
        filtered = TestSuite()

        for test in suite:
            testname = str(test)
            if '.tests.' in testname and self.package in testname:
                filtered.addTest(test)
        return filtered
开发者ID:Madsn,项目名称:angularjs-django-rest-framework-seed,代码行数:9,代码来源:__init__.py


示例11: _runTest

 def _runTest(self):
     """method used to run a test."""
     suite = TestSuite()
     suite.addTest(self.test)
     runner = _TestRunner()
     result = runner.run(suite)
     if result.err is not None:
         desc = str(result.err) + "\n" + \
                "".join(traceback.format_tb(result.err[2]))
         raise Exception(desc)
开发者ID:boundlessgeo,项目名称:qgis-tester-plugin,代码行数:10,代码来源:test.py


示例12: suite

def suite():
  suite = TestSuite()
  suite.addTest(SimpleKindAwareInsertTest())
  suite.addTest(KindAwareInsertWithParentTest())
  suite.addTest(SimpleKindAwareQueryTest())
  suite.addTest(AncestorQueryTest())
  return suite
开发者ID:hiranya911,项目名称:hawkeye,代码行数:7,代码来源:datastore_tests.py


示例13: load_tests

def load_tests(loader, standard_tests, pattern):
    """
    Generate a test suite of tests from several test classes.

    Specifically:
        - test_volume_attached_after_migration from
            LiveMigratateServerWithVolumeTests
        - test_format_and_mount_disks, test_live_migrate_server,
          test_verify_ephemeral_disks_mounted from
          LiveMigratateServerWithVolumeTests

    These tests are added in a specific order to the load_tests method to
    enforce run order. This run order will ensure that the instance
    generated during LiveMigratateServerWithVolumeTests setUpClass
    is setup and then migrated in the appropriate order for these tests.
    """
    suite = TestSuite()

    # During the LiveMigratateServerWithVolumeTests setup an instance is
    # created that will be used for the tests in this test module
    suite.addTest(LiveMigratateServerWithVolumeTests(
        "test_format_and_mount_disks"))
    # This test performs a live migrate on the instance
    suite.addTest(LiveMigratateServerWithVolumeTests(
        "test_live_migrate_server"))
    suite.addTest(LiveMigratateServerWithVolumeTests(
        "test_verify_ephemeral_disks_mounted"))
    suite.addTest(LiveMigratateServerWithVolumeTests(
        "test_volume_attached_after_migration"))
    return suite
开发者ID:bhushan5,项目名称:cloudroast,代码行数:30,代码来源:test_server_volume_live_migration.py


示例14: _get_suite

    def _get_suite(self, test_labels, discover_kwargs, extra_tests, methods):
        suite = TestSuite()
        for label in test_labels:
            kwargs = discover_kwargs.copy()
            tests = None

            label_as_path = os.path.abspath(label)

            # if a module, or "module.ClassName[.method_name]", just run those
            if not os.path.exists(label_as_path):
                tests = self.test_loader.loadTestsFromName(label)
            elif os.path.isdir(label_as_path) and not self.top_level:
                # Try to be a bit smarter than unittest about finding the
                # default top-level for a given directory path, to avoid
                # breaking relative imports. (Unittest's default is to set
                # top-level equal to the path, which means relative imports
                # will result in "Attempted relative import in non-package.").

                # We'd be happy to skip this and require dotted module paths
                # (which don't cause this problem) instead of file paths (which
                # do), but in the case of a directory in the cwd, which would
                # be equally valid if considered as a top-level module or as a
                # directory path, unittest unfortunately prefers the latter.

                top_level = label_as_path
                while True:
                    init_py = os.path.join(top_level, '__init__.py')
                    if os.path.exists(init_py):
                        try_next = os.path.dirname(top_level)
                        if try_next == top_level:
                            # __init__.py all the way down? give up.
                            break
                        top_level = try_next
                        continue
                    break
                kwargs['top_level_dir'] = top_level

            if not (tests and tests.countTestCases()):
                # if no tests found, it's probably a package; try discovery
                tests = self.test_loader.discover(start_dir=label, **kwargs)

                # make unittest forget the top-level dir it calculated from this
                # run, to support running tests from two different top-levels.
                self.test_loader._top_level_dir = None

            tests = self.get_tests_defined_in_methods_or_none(tests, methods)
            if tests:
                suite.addTests(tests)

        for test in extra_tests:
            suite.addTest(test)
        return suite
开发者ID:druids,项目名称:django-juno-testrunner,代码行数:52,代码来源:runner.py


示例15: run

 def run(self):
     global THIS_PATH, PKG_DIR, TEST_DIR
     
     sys.path.insert(0, PKG_DIR)
     
     suite = TestSuite()
     loaded = unittest.defaultTestLoader.discover(TEST_DIR, pattern='*Test.py')
     
     for all_test_suite in loaded:
         for test_suite in all_test_suite:
             suite.addTests(test_suite)
     
     runner = TextTestRunner(verbosity = 2)
     runner.run(suite)
开发者ID:moisespsena,项目名称:py-sdag,代码行数:14,代码来源:setup.py


示例16: load_tests

def load_tests(loader, standard_tests, pattern):
    suite = TestSuite()
    suite.addTest(DeactivateReactivateServers(
        'test_deactivate_snapshot_image'))
    suite.addTest(DeactivateReactivateServers(
        'test_create_server_from_deactivated_image_invalid'))
    suite.addTest(DeactivateReactivateServers(
        'test_reactivate_snapshot_image'))
    suite.addTest(DeactivateReactivateServers(
        'test_create_server_from_reactivated_image'))
    return suite
开发者ID:kshortwindham,项目名称:cloudroast,代码行数:11,代码来源:deactivate_reactivate_servers_test.py


示例17: __init__

  def __init__(self, name, short_name):
    """
    Create a new instance of HawkeyeTestSuite with the given name and short
    name. Use the addTest instance method to add test cases to the suite.

    Args:
      name  A descriptive name for the test suite
      short_name  A shorter but unique name for the test suite. Should be
                  ideally just one word. This short name is used to name
                  log files and other command line options related to this
                  test suite.
    """
    TestSuite.__init__(self)
    self.name = name
    self.short_name = short_name
开发者ID:shatterednirvana,项目名称:hawkeye,代码行数:15,代码来源:hawkeye_utils.py


示例18: load_tests

def load_tests(loader, standard_tests, pattern):
    suite = TestSuite()
    suite.addTest(LiveMigratationServerTests(
        "test_format_and_mount_disks"))
    suite.addTest(LiveMigratationServerTests(
        "test_live_migrate_server"))
    suite.addTest(LiveMigratationServerTests(
        "test_verify_ephemeral_disks_mounted"))
    return suite
开发者ID:kshortwindham,项目名称:cloudroast,代码行数:9,代码来源:test_server_live_migration.py


示例19: creat

def creat():
    loadcase=TestLoader()
    testsuite=[]
    suite1=TestSuite()
    suite2=TestSuite()
    caseclass_dict={}
    def backcount(d):
        n=0
        for i in d.values():
            n+=i
        return n
    def caseclass_count(caselist):
        print 'dir caselist',caselist
        for casename in caselist:
            module=loadcase._get_module_from_name(casename)
            for name in dir(module):
                obj = getattr(module,name)
                if isinstance(obj, type) and issubclass(obj, case.TestCase):
                    modeltestcases_list=getTestCaseNames(obj,'test')
                    caseclass_dict[obj]=len(modeltestcases_list)
        return caseclass_dict
    classcase_dict=caseclass_count(backcaselist(dirs+'/bank_case'))
    
    case_and_count_list=back_list(classcase_dict)
    sort_case=SelectSort(case_and_count_list)
    print sort_case
    for i in range(len(sort_case)):
        if i%2==0:
            suite1.addTest(loadcase.loadTestsFromTestCase([x for x in sort_case[i].keys()][0]))
            [x for x in sort_case[i].keys()][0].remoteip='http://172.17.2.136:3344/wd/hub'
        else:
            suite2.addTest(loadcase.loadTestsFromTestCase([x for x in sort_case[i].keys()][0]))
            [x for x in sort_case[i].keys()][0].remoteip='http://172.17.2.57:3344/wd/hub'
    
    print 'suite1',suite1
    print 'suite2',suite2
    testsuite.append(suite1)
    testsuite.append(suite2)
    return testsuite
开发者ID:dhaibo1986,项目名称:PythonWork,代码行数:39,代码来源:all_test.py


示例20: GOConnector

        for seq in go.all_seqs:
            self.assertTrue(seq.seq_id in expected, seq.seq_id)

        go = GOConnector(record_index, batch_size, tempfile=self.tempfile)
        count = go.amigo_batch_mode()  # do nothing
        self.assertEqual(0, count)


        tempout = open(self.tempfile, "r")
        all_lines = tempout.readlines()
        tempout.close()
        tempout = open(self.tempfile, "w")
        for line in all_lines:
            tempout.write(line)
            if line.startswith("ENDResult"):
                break
        tempout.close()

        go = GOConnector(record_index, batch_size, tempfile=self.tempfile)
        resume_count = go.amigo_batch_mode()
        self.assertEqual(expected_count - 1, resume_count)

if __name__ == '__main__':
#    unittest.main(verbosity=2)
#    Test = TestGoConnector()
    suite = TestSuite()
#    suite.addTest(TestGoConnector("test_parse_seq"))
    suite.addTest(TestGoConnector("test_batch_mode"))
#    suite.addTest(TestGoConnector("test_GoConnector_long"))
    unittest.TextTestRunner().run(suite)
开发者ID:YoderLab,项目名称:MMAP,代码行数:30,代码来源:test_go_connector.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python support.is_instance函数代码示例发布时间:2022-05-27
下一篇:
Python runner._WritelnDecorator函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap