本文整理汇总了Python中unittest.TestCase.setUpClass方法的典型用法代码示例。如果您正苦于以下问题:Python TestCase.setUpClass方法的具体用法?Python TestCase.setUpClass怎么用?Python TestCase.setUpClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unittest.TestCase
的用法示例。
在下文中一共展示了TestCase.setUpClass方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUpClass
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import setUpClass [as 别名]
def setUpClass(cls):
TestCase.setUpClass()
virtwho.parser.VIRTWHO_CONF_DIR = '/this/does/not/exist'
virtwho.parser.VIRTWHO_GENERAL_CONF_PATH = '/this/does/not/exist.conf'
cls.queue = Queue()
cls.sam = FakeSam(cls.queue)
cls.sam.start()
示例2: setUpClass
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import setUpClass [as 别名]
def setUpClass(cls) -> None:
TestCase.setUpClass()
cls.database_uri = os.environ.get(
cls.DATABASE_ENVIRONMENT_VARIABLE_KEY,
default=cls.SQLITE_IN_MEMORY_URI
)
cls.engine = create_engine(cls.database_uri)
cls.session = Session(bind=cls.engine, expire_on_commit=False)
cls.database = DatabaseSchema()
cls.database.metadata.create_all(bind=cls.engine)
示例3: setUpClass
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import setUpClass [as 别名]
def setUpClass(cls):
""" setUp method for tests in this class """
logger.debug("----*---- setupclass %r", cls)
TestCase.setUpClass()
logger.debug('in SetUpClass, refcnt : %d', LPBaseTest.ref_count)
if not LPBaseTest.wrapper:
LPBaseTest.wrapper = MHLinphoneWrapper(
rc_config_file=os.path.join(LPConfig.get_default_lp_data_dir(),
"unit_test.linphonerc")
)
LPBaseTest.wrapper.init()
if LPBaseTest.wrapper.proxy_enable:
if not LPBaseTest.wrapper.is_ready_to_call():
server = LPBaseTest.wrapper.wait_for_registered(20)
assert server is not None
LPBaseTest.ref_count += 1
示例4: setUpClass
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import setUpClass [as 别名]
def setUpClass(cls):
TestCase.setUpClass()
cls.manager = Manager()
cls.assoc = cls.manager.dict()
cls.sam = FakeSam(cls.assoc)
cls.sam.start()
示例5: setUpClass
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import setUpClass [as 别名]
def setUpClass(cls):
TestCase.setUpClass()
cls.queue = Queue()
cls.sam = FakeSam(cls.queue)
cls.sam.start()
示例6: setUpClass
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import setUpClass [as 别名]
def setUpClass(cls):
# Setup the test environment.
# 1. create the test app user
# 2. set up app data under /home/sandboxtest/ (setup the jail)
# 3. copy the test apps to /home/sandboxtest/app/
TestCase.setUpClass()