Style
This commit is contained in:
parent
36bf6c9009
commit
2acc356ed4
@ -3239,17 +3239,17 @@ def test_relative_view_path_on_command_line_is_made_absolute(tmpdir, config):
|
|||||||
|
|
||||||
|
|
||||||
def test_environment_created_in_users_location(mutable_config, tmpdir):
|
def test_environment_created_in_users_location(mutable_config, tmpdir):
|
||||||
"""Test that an environment is created in a location based on the config"""
|
"""Test that an environment is created in a location based on the config"""
|
||||||
spack.config.set("config:environments_root", str(tmpdir.join("envs")))
|
spack.config.set("config:environments_root", str(tmpdir.join("envs")))
|
||||||
env_dir = spack.config.get("config:environments_root")
|
env_dir = spack.config.get("config:environments_root")
|
||||||
|
|
||||||
assert tmpdir.strpath in env_dir
|
assert tmpdir.strpath in env_dir
|
||||||
assert not os.path.isdir(env_dir)
|
assert not os.path.isdir(env_dir)
|
||||||
|
|
||||||
dir_name = "user_env"
|
dir_name = "user_env"
|
||||||
env("create", dir_name)
|
env("create", dir_name)
|
||||||
out = env("list")
|
out = env("list")
|
||||||
|
|
||||||
assert dir_name in out
|
assert dir_name in out
|
||||||
assert env_dir in ev.root(dir_name)
|
assert env_dir in ev.root(dir_name)
|
||||||
assert os.path.isdir(os.path.join(env_dir, dir_name))
|
assert os.path.isdir(os.path.join(env_dir, dir_name))
|
||||||
|
@ -146,18 +146,18 @@ def test_user_view_path_is_not_canonicalized_in_yaml(tmpdir, config):
|
|||||||
|
|
||||||
|
|
||||||
def test_environment_cant_modify_environments_root(tmpdir):
|
def test_environment_cant_modify_environments_root(tmpdir):
|
||||||
filename = str(tmpdir.join("spack.yaml"))
|
filename = str(tmpdir.join("spack.yaml"))
|
||||||
with open(filename, "w") as f:
|
with open(filename, "w") as f:
|
||||||
f.write(
|
f.write(
|
||||||
"""\
|
"""\
|
||||||
spack:
|
spack:
|
||||||
config:
|
config:
|
||||||
environments_root: /a/black/hole
|
environments_root: /a/black/hole
|
||||||
view: false
|
view: false
|
||||||
specs: []
|
specs: []
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
with tmpdir.as_cwd():
|
with tmpdir.as_cwd():
|
||||||
with pytest.raises(ev.SpackEnvironmentError):
|
with pytest.raises(ev.SpackEnvironmentError):
|
||||||
e = ev.Environment(tmpdir.strpath)
|
e = ev.Environment(tmpdir.strpath)
|
||||||
ev.activate(e)
|
ev.activate(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user