Skip to content

Commit

Permalink
Add a test of using bad file extension with dump command
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyMcCormick committed Feb 24, 2025
1 parent 60626ca commit 1d56d25
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ def test_dump_json(self) -> None:
finally:
os.remove(temp_file_name)

def test_dump_invalid_file_extension(self) -> None:
"""Test for ``dump`` command with JSON output."""
runner = CliRunner()
result = runner.invoke(cli, ["dump", TEST_YAML, "out.bad"], catch_exceptions=False)
print(result.output)
self.assertNotEqual(result.exit_code, 0)


if __name__ == "__main__":
unittest.main()

0 comments on commit 1d56d25

Please sign in to comment.