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
21 changes: 20 additions & 1 deletion jetstream/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,28 @@ def test_validate_private_example_config_no_dataset(self, runner, monkeypatch):
config.write(conf)

result = runner.invoke(cli.validate_config, ["my_cool_experiment.toml", "--is_private"])
assert result.exit_code
assert result.exit_code == 1
assert "dataset_id needs to be explicitly set for private experiments" in str(result)

def test_validate_invalid_toml_exit_code(self, runner, monkeypatch):
monkeypatch.setattr("jetstream.cli.ExperimentCollection.from_experimenter", cli_experiments)
with runner.isolated_filesystem():
conf = dedent(
"""
[experiment
start_date = "2020-12-31"
end_date = "2021-02-01"
start_date = "2020-12-31"
"""
)

with open("my_cool_experiment.toml", "w") as config:
config.write(conf)

result = runner.invoke(cli.validate_config, ["my_cool_experiment.toml"])
assert result.exit_code == 1
assert "TomlDecodeError" in str(result)

def test_validate_example_outcome_config(self, runner, monkeypatch):
monkeypatch.setattr("jetstream.cli.ExperimentCollection.from_experimenter", cli_experiments)
with runner.isolated_filesystem():
Expand Down