Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions tests/everest/test_everlint.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ def test_extra_key(min_config):
{"forward_model": ["not_a_job"]},
"unknown job not_a_job",
),
(
{"environment": {"simulation_folder": "/usr/bin/unwriteable"}},
"User does not have write access to",
),
(
{"environment": {"output_folder": ("super long path" * 300)}},
"output_folder\n.* File name too long",
Expand Down Expand Up @@ -168,6 +164,28 @@ def test_invalid_subconfig(extra_config, min_config, expected):
EverestConfig(**min_config)


@pytest.mark.xfail(
reason=(
"behavior must be looked at. Current code requires all directories on path"
"to be unwritable to raise validation error."
)
)
def test_that_simulation_folder_without_write_access_raises_validation_error(
min_config, tmp_path
):
unwritable = tmp_path / "unwritable"
unwritable.mkdir()
original_mode = unwritable.stat().st_mode
unwritable.chmod(0o555)

try:
min_config["environment"] = {"simulation_folder": str(unwritable)}
with pytest.raises(ValidationError, match="User does not have write access to"):
EverestConfig(**min_config)
finally:
unwritable.chmod(original_mode)


@pytest.mark.parametrize(
("link", "source", "target"),
[
Expand Down
Loading