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


Python TestCase.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        '''
        initialize the test class
        '''
        TestCase.__init__(self, *args, **kwargs)

        LOG.error("ConfigFile: %s " % config['__file__'])

        conffile = config['__file__']

        if pylons.test.pylonsapp:
            wsgiapp = pylons.test.pylonsapp
        else:
            wsgiapp = loadapp('config: %s' % config['__file__'])

        self.app = TestApp(wsgiapp)

        conf = None
        if conffile.startswith('/'):
            conf = appconfig('config:%s' % config['__file__'], relative_to=None)
        else:
            raise Exception('dont know how to load the application relatively')
        #conf = appconfig('config: %s' % config['__file__'], relative_to=rel)

        load_environment(conf.global_conf, conf.local_conf)
        self.appconf = conf

        url._push_object(URLGenerator(config['routes.map'], environ))

        self.isSelfTest = False
        if env.has_key("privacyidea.selfTest"):
            self.isSelfTest = True

        self.license = 'CE'
        return
开发者ID:itd,项目名称:privacyidea,代码行数:37,代码来源:__init__.py

示例2: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     if pylons.test.pylonsapp:
         wsgiapp = pylons.test.pylonsapp
     else:
         wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
     self.app = paste.fixture.TestApp(wsgiapp)
     TestCase.__init__(self, *args, **kwargs)
开发者ID:pawelniewie,项目名称:5groszy.pl,代码行数:9,代码来源:__init__.py

示例3: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
 def __init__(self, methodName='runTest'):
     # Must call super class init to properly initialize unittest class
     TestCase.__init__(self, methodName)
     #
     # initialize colors and reporter properly if executed from Main
     if Verifier.__execFromMain:
         # enable color (unless nocolors) and summary report
         if not Verifier.__nocolors:
             Verifier.COLORS = color.colors
         if Verifier.reporter is None:
             # make reporter static so that it remains across runs
             Verifier.reporter = TestReporter(self.COLORS)
         #
         # copy to this instance
         self.reporter = Verifier.reporter
     #
     # Protected variables are set per run to facilitate test-harness methods.
     self._dir = None
     self._testSM = None
     self._smApp = None
     self._dontSendQuit = False  # used in rare cases to NOT send 'quit'
     self._preserveImpl = False
     self._subdirsToClean = []
     self._keepGen = False
     self._useSimStateStart = False
     self._enableGui = False
     self._verbose = False
     self._suiteVersion = None
开发者ID:JPLOpenSource,项目名称:SCA,代码行数:30,代码来源:verifier.py

示例4: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
 def __init__(self, method='runTest'):
     TestCase.__init__(self, method)
     self.method = method
     self.pdb_script = None
     self.fnull = None
     self.debugger = None
     self.netbeans_port = 3219
开发者ID:jimmysitu,项目名称:pyclewn,代码行数:9,代码来源:test_support.py

示例5: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
	def __init__(self, *args, **kwargs):
		wsgiapp = pylons.test.pylonsapp
		config = wsgiapp.config
		self.app = PatchedTestApp(wsgiapp)
		app_globals._push_object(config['pylons.app_globals'])
		url._push_object(URLGenerator(config['routes.map'], environ))
		TestCase.__init__(self, *args, **kwargs)
开发者ID:yoshrote,项目名称:Columns,代码行数:9,代码来源:__init__.py

示例6: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)

        containers = (
            ResultContainer(
                linter='foo',
                path='a/b/c.txt',
                message="oh no foo",
                lineno=1,
            ),
            ResultContainer(
                linter='bar',
                path='d/e/f.txt',
                message="oh no bar",
                hint="try baz instead",
                level='warning',
                lineno=4,
                column=2,
                rule="bar-not-allowed",
            ),
            ResultContainer(
                linter='baz',
                path='a/b/c.txt',
                message="oh no baz",
                lineno=4,
                source="if baz:",
            ),
        )

        self.results = defaultdict(list)
        for c in containers:
            self.results[c.path].append(c)
开发者ID:brendandahl,项目名称:positron,代码行数:34,代码来源:test_formatters.py

示例7: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     """ TestController init """
     wsgiapp = pylons.test.pylonsapp
     config = wsgiapp.config
     self.app = TestApp(wsgiapp)
     url._push_object(URLGenerator(config['routes.map'], environ))
     TestCase.__init__(self, *args, **kwargs)
开发者ID:anzarafaq,项目名称:cronusagent,代码行数:9,代码来源:__init__.py

示例8: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     if pylons.test.pylonsapp:
         wsgiapp = pylons.test.pylonsapp
     else:
         wsgiapp = loadapp('config:%s' % config['__file__'])
     self.app = TestApp(wsgiapp)
     TestCase.__init__(self, *args, **kwargs)
开发者ID:cmci,项目名称:cecog,代码行数:9,代码来源:__init__.py

示例9: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
    def __init__(self, methodName):
        """
        Class constructor. Starts a Changes class for use in other tests.
        """
        TestCase.__init__(self, methodName)

        self.changes = Changes(filename='debexpo/tests/changes/synce-hal_0.1-1_source.changes')
开发者ID:certik,项目名称:debexpo,代码行数:9,代码来源:test_changes.py

示例10: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        wsgiapp = pylons.test.pylonsapp
        config = wsgiapp.config
        self.app = TestApp(wsgiapp)
        url._push_object(URLGenerator(config['routes.map'], environ))
        TestCase.__init__(self, *args, **kwargs)

        self.pkey, self.cert = _generate_mock_cert()
开发者ID:andrea-manzi,项目名称:fts3-rest,代码行数:10,代码来源:__init__.py

示例11: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     wsgiapp = pylons.test.pylonsapp
     config = wsgiapp.config
     self.app = OptionsTestApp(wsgiapp)
     url._push_object(URLGenerator(config['routes.map'], environ))
     TestCase.__init__(self, *args, **kwargs)
     self.from_date = datetime(1990,1,1).isoformat() + "Z"
     self.controllerName = None
开发者ID:wegrata,项目名称:LearningRegistry,代码行数:10,代码来源:__init__.py

示例12: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)

        self.backend = None
        self.weboob = Weboob()

        if self.weboob.load_backends(modules=[self.BACKEND]):
            self.backend = choice(self.weboob.backend_instances.values())
开发者ID:jocelynj,项目名称:weboob,代码行数:10,代码来源:test.py

示例13: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     wsgiapp = pylons.test.pylonsapp
     config = wsgiapp.application.config
     self.config = config
     self.app = TestApp(wsgiapp)
     self.g = self.config['pylons.app_globals']
     url._push_object(URLGenerator(config['routes.map'], environ))
     TestCase.__init__(self, *args, **kwargs)
开发者ID:hwine,项目名称:build-buildapi,代码行数:10,代码来源:__init__.py

示例14: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     wsgiapp = pylons.test.pylonsapp
     config = wsgiapp.config
     self.app = webtest.TestApp(wsgiapp)
     url._push_object(URLGenerator(config['routes.map'], environ))
     self.__setattrs__()
     self.__setcreateparams__()
     TestCase.__init__(self, *args, **kwargs)
开发者ID:FieldDB,项目名称:old,代码行数:10,代码来源:__init__.py

示例15: __init__

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     if pylons.test.pylonsapp:
         wsgiapp = pylons.test.pylonsapp
     else:
         wsgiapp = loadapp('config:%s' % config['__file__'])
     self.app = TestApp(wsgiapp)
     url._push_object(URLGenerator(config['routes.map'], environ))
     TestCase.__init__(self, *args, **kwargs)
开发者ID:wiredfool,项目名称:fmod,代码行数:10,代码来源:__init__.py


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