Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions pytest/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from click.testing import CliRunner

from uncompyle6.bin import uncompile


def test_output_option_accepts_new_file(tmp_path, monkeypatch):
input_path = tmp_path / "input.pyc"
output_path = tmp_path / "new-output.py"
input_path.write_bytes(b"")

monkeypatch.setattr(uncompile, "main", lambda *args, **kwargs: (0, 0, 0, 0))
result = CliRunner().invoke(
uncompile.main_bin,
["--output", str(output_path), str(input_path)],
)

assert result.exit_code == 0
2 changes: 1 addition & 1 deletion uncompyle6/bin/uncompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def usage():
"-o",
"outfile",
type=click.Path(
exists=True, file_okay=True, dir_okay=True, writable=True, resolve_path=True
exists=False, file_okay=True, dir_okay=True, writable=True, resolve_path=True
),
required=False,
)
Expand Down
Loading