本文整理匯總了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)