本文整理汇总了Python中tests.TestCase方法的典型用法代码示例。如果您正苦于以下问题:Python tests.TestCase方法的具体用法?Python tests.TestCase怎么用?Python tests.TestCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests
的用法示例。
在下文中一共展示了tests.TestCase方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runTest
# 需要导入模块: import tests [as 别名]
# 或者: from tests import TestCase [as 别名]
def runTest(self):
# Check build_dist script
from setup import fix_dist
fix_dist()
# Check desktop file
try:
subprocess.check_call(['desktop-file-validate', 'xdg/zim.desktop'])
except OSError:
print("Could not run desktop-file-validate")
#~ @tests.slowTest
#~ class TestNotebookUpgrade(tests.TestCase):
#~
#~ def runTest(self):
#~ '''Test if included notebooks are up to date'''
#~ from zim.fs import Dir
#~ from zim.notebook import init_notebook
#~ for path in ('data/manual', 'HACKING'):
#~ notebook = init_notebook(Dir(path))
#~ self.assertTrue(not notebook.needs_upgrade)
示例2: _get_sql
# 需要导入模块: import tests [as 别名]
# 或者: from tests import TestCase [as 别名]
def _get_sql(files):
folder = MockFolder('/mock/notebook/')
indexer = buildUpdateIter(folder)
for path, text in files:
folder.file(path).write(text)
indexer.check_and_update()
lines = list(indexer.db.iterdump())
indexer.db.close()
return '\n'.join(lines)
#class TestMemoryIndex(tests.TestCase):
#
# def runTest(self):
# db = new_test_database()
# for line in db.iterdump():
# print line
示例3: setUpClass
# 需要导入模块: import tests [as 别名]
# 或者: from tests import TestCase [as 别名]
def setUpClass(cls):
tests.TestCase.setUpClass()
preferences = dict((p[0], p[4]) for p in ui_preferences)
cls.view = TextView(preferences)
cls.buffer = TextBuffer(None, None)
cls.view.set_buffer(cls.buffer)
press(cls.view, 'aaa\n')
start, end = cls.buffer.get_bounds()
assert cls.buffer.get_text(start, end, True) == 'aaa\n', 'Just checking test routines work'
示例4: __init__
# 需要导入模块: import tests [as 别名]
# 或者: from tests import TestCase [as 别名]
def __init__(self, *a):
self._code_files = []
tests.TestCase.__init__(self, *a)