本文整理匯總了Python中qibuild.test.conftest.TestBuildWorkTree.get_env方法的典型用法代碼示例。如果您正苦於以下問題:Python TestBuildWorkTree.get_env方法的具體用法?Python TestBuildWorkTree.get_env怎麽用?Python TestBuildWorkTree.get_env使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qibuild.test.conftest.TestBuildWorkTree
的用法示例。
在下文中一共展示了TestBuildWorkTree.get_env方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_set_pythonhome
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import get_env [as 別名]
def test_set_pythonhome(toolchains, cd_to_tmpdir):
toolchains.create("foo")
qibuild.config.add_build_config("foo", toolchain="foo")
python_package = toolchains.add_package("foo", "python")
build_worktree = TestBuildWorkTree()
build_worktree.set_active_config("foo")
env = build_worktree.get_env()
assert env["PYTHONHOME"] == python_package.path
示例2: test_set_pythonhome
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import get_env [as 別名]
def test_set_pythonhome(toolchains, cd_to_tmpdir):
toolchains.create("foo")
qibuild.config.add_build_config("foo", toolchain="foo")
python_package = toolchains.add_package("foo", "python")
build_worktree = TestBuildWorkTree()
build_worktree.set_active_config("foo")
env = build_worktree.get_env()
if sys.platform == "darwin":
assert env["PYTHONHOME"] == python_package.path + "/Python.framework/Versions/2.7"
else:
assert env["PYTHONHOME"] == python_package.path
示例3: test_get_env
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import get_env [as 別名]
def test_get_env(toolchains, cd_to_tmpdir):
toolchains.create("foo")
qibuild.config.add_build_config("foo", toolchain="foo")
bar_package = toolchains.add_package("foo", "bar")
build_worktree = TestBuildWorkTree()
build_worktree.set_active_config("foo")
world_proj = build_worktree.create_project("world")
env = build_worktree.get_env()
if sys.platform.startswith("linux"):
assert env["LD_LIBRARY_PATH"] == "%s:%s" % (
os.path.join(world_proj.sdk_directory, "lib"),
os.path.join(bar_package.path, "lib"))
if sys.platform.startswith("win"):
old_path = os.environ["PATH"]
assert env["PATH"] == "%s;%s;%s" % (
os.path.join(world_proj.sdk_directory, "bin"),
os.path.join(bar_package.path, "bin"),
old_path)
if sys.platform == "darwin":
assert env["DYLD_LIBRARY_PATH"] == "%s:%s" % (
os.path.join(world_proj.sdk_directory, "lib"),
os.path.join(bar_package.path, "lib"))
assert env["DYLD_FRAMEWORK_PATH"] == bar_package.path