Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Konkrad committed Jul 10, 2024
1 parent 7756474 commit a3b4755
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
import gzip
import shutil

from typer.testing import CliRunner
from pyodide_lock.cli import main

DATA_DIR = Path(__file__).parent / "data"

from pyodide_lock.cli import add_wheels

runner = CliRunner()

def test_cli_modify_file(test_wheel_list, tmp_path):
source_path = DATA_DIR / f"pyodide-lock-0.23.3.json.gz"
Expand All @@ -15,7 +19,8 @@ def test_cli_modify_file(test_wheel_list, tmp_path):
with target_path.open("wb") as fh_out:
shutil.copyfileobj(fh_in, fh_out)

add_wheels(wheels=test_wheel_list, input=target_path, output=new_lock_path)
result = runner.invoke(main, ["--input="+str(target_path), "--output="+str(new_lock_path), str(test_wheel_list[0])])
assert result.exit_code == 0
assert target_path.read_text() != new_lock_path.read_text()


0 comments on commit a3b4755

Please sign in to comment.