本文整理匯總了Python中qibuild.test.conftest.TestBuildWorkTree.add_test_project方法的典型用法代碼示例。如果您正苦於以下問題:Python TestBuildWorkTree.add_test_project方法的具體用法?Python TestBuildWorkTree.add_test_project怎麽用?Python TestBuildWorkTree.add_test_project使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qibuild.test.conftest.TestBuildWorkTree
的用法示例。
在下文中一共展示了TestBuildWorkTree.add_test_project方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_simple
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import add_test_project [as 別名]
def test_simple(qilinguist_action, record_messages):
""" Test Simple """
build_worktree = TestBuildWorkTree()
build_worktree.add_test_project("translateme/qt")
qilinguist_action("list")
assert record_messages.find("\\*\\s+helloqt")
assert record_messages.find("\\*\\s+translate")
示例2: test_qt
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import add_test_project [as 別名]
def test_qt(qilinguist_action):
build_worktree = TestBuildWorkTree()
project = build_worktree.add_test_project("translateme/qt")
try:
project.configure()
except Exception:
print "Qt not installed, skipping"
return
project.build()
qilinguist_action("update", "helloqt")
# Translate in French:
fr_ts = os.path.join(project.path, "po", "fr_FR.ts")
tree = qisys.qixml.read(fr_ts)
root = tree.getroot()
tr_elem = root.find("context/message/translation")
assert tr_elem is not None
tr_elem.attrib.clear()
tr_elem.text = "Bonjour, monde"
qisys.qixml.write(root, fr_ts)
qilinguist_action("release", "helloqt")
translateme = qibuild.find.find([project.sdk_directory], "translateme")
cmd = [translateme,
os.path.join(project.path, "po"),
"fr_FR"]
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
(out, _) = process.communicate()
assert "Bonjour, monde" in out
示例3: test_non_translated_messages_qt
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import add_test_project [as 別名]
def test_non_translated_messages_qt(qilinguist_action):
build_worktree = TestBuildWorkTree()
project = build_worktree.add_test_project("translateme/qt")
qilinguist_action("update", "helloqt")
qilinguist_action("release", "helloqt", raises=True)