Skip to content

Commit

Permalink
Add a test for env override in yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
BabyChouSr committed Jul 27, 2024
1 parent 48ff152 commit 255257b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_yaml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,13 @@ def test_invalid_empty_envs(tmp_path):
with pytest.raises(ValueError) as e:
Task.from_yaml(config_path)
assert 'Environment variable \'env_key2\' is None.' in e.value.args[0]

def test_replace_envs_in_path(tmpdir, tmp_path):
config_path = _create_config_file(
textwrap.dedent(f"""\
envs:
env_key1: {tmpdir}
workdir: $env_key1
"""), tmp_path)
task = Task.from_yaml(config_path)
assert task.workdir == tmpdir

0 comments on commit 255257b

Please sign in to comment.