Skip to content

Commit

Permalink
Add test to make sure check_output works as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasNickel committed Jan 24, 2023
1 parent 852460a commit b01a420
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ctapipe/core/tests/test_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,20 @@ def test_tool_logging_quiet(capsys):
assert len(log) == 0


def test_tool_overwrite_output(capsys, tmp_path):
path = tmp_path / "overwrite_dummy"
tool = Tool()
# path does not exist
tool.check_output(path)
# path exists and no overwrite
path.touch()
with pytest.raises(ToolConfigurationError):
tool.check_output(path)
# path exists and overwrite is True
tool.overwrite = True
tool.check_output(path)


def test_invalid_traits(tmp_path, caplog):
caplog.set_level(logging.INFO, logger="ctapipe")

Expand Down

0 comments on commit b01a420

Please sign in to comment.