Skip to content
Open
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
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ dev = [
]
[project.scripts]
mllam_data_prep = "mllam_data_prep:cli.call"

[tool.pytest.ini_options]
markers = [
"slow: marks tests requiring network access or AWS credentials (deselect with '-m \"not slow\"')",
]
12 changes: 12 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import subprocess
import tempfile

import pytest
Expand All @@ -6,9 +7,20 @@
from mllam_data_prep.cli import call


@pytest.mark.slow
@pytest.mark.parametrize("args", [["example.danra.yaml"]])
def test_call(args):
with tempfile.TemporaryDirectory(suffix=".zarr") as tmpdir:
args.extend(["--output", tmpdir])
call(args)
_ = xr.open_zarr(tmpdir)


def test_cli_entrypoint_help():
"""Test the actual installed CLI entry point works as a subprocess."""
result = subprocess.run(
["mllam_data_prep", "--help"],
capture_output=True, text=True
)
assert result.returncode == 0
assert "config" in result.stdout.lower()