本文整理匯總了Python中qibuild.test.conftest.TestBuildWorkTree.set_default_config方法的典型用法代碼示例。如果您正苦於以下問題:Python TestBuildWorkTree.set_default_config方法的具體用法?Python TestBuildWorkTree.set_default_config怎麽用?Python TestBuildWorkTree.set_default_config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qibuild.test.conftest.TestBuildWorkTree
的用法示例。
在下文中一共展示了TestBuildWorkTree.set_default_config方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_set_default_config
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_default_config [as 別名]
def test_set_default_config(cd_to_tmpdir):
qibuild.config.add_build_config("foo")
build_worktree = TestBuildWorkTree()
build_worktree.set_default_config("foo")
assert build_worktree.default_config == "foo"
build_worktree2 = TestBuildWorkTree()
assert build_worktree2.default_config == "foo"
示例2: test_when_is_default
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_default_config [as 別名]
def test_when_is_default(qitoolchain_action):
""" Test When Is Default """
qitoolchain_action("create", "foo")
qibuild.config.add_build_config("foo", toolchain="foo")
test_build_worktre1 = TestBuildWorkTree()
test_build_worktre1.set_default_config("foo")
qitoolchain_action("remove", "foo", "--force")
test_build_worktre2 = TestBuildWorkTree()
with pytest.raises(Exception) as e:
test_build_worktre2.toolchain # pylint:disable=pointless-statement
assert "No such toolchain" in e.value.message
示例3: test_when_is_default
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_default_config [as 別名]
def test_when_is_default(qitoolchain_action):
qitoolchain_action("create", "foo")
qibuild.config.add_build_config("foo", toolchain="foo")
test_build_worktre1 = TestBuildWorkTree()
test_build_worktre1.set_default_config("foo")
qitoolchain_action("remove", "foo", "--force")
test_build_worktre2 = TestBuildWorkTree()
# pylint:disable-msg=E1101
with pytest.raises(Exception) as e:
test_build_worktre2.toolchain
assert "No such toolchain" in e.value.message