本文整理汇总了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
示例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)
示例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
示例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
示例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)
示例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)
示例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)
示例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)
示例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')
示例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()
示例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
示例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())
示例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)
示例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)
示例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)