Skip to content

Commit

Permalink
Create cli_test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jannikmi committed Jul 10, 2022
1 parent 3460a05 commit 04fbdc3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/cli_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import subprocess
from pathlib import Path
from typing import List

import pytest

PROJECT_DIR = Path(__file__).parent.parent
EXAMPLE_FILE = PROJECT_DIR / "example.json"


@pytest.mark.parametrize(
"cmd",
[
f"extremitypathfinder {EXAMPLE_FILE} -s 2.5 3.2 -g 7.9 6.8",
],
)
def test_main(cmd: List[str]):
res = subprocess.getoutput(cmd)
assert not res.endswith("command not found"), "package not installed"
splits = res.split(" ")
length = float(splits[-1])
print("length:", length)
path = " ".join(splits[:-1])
print("path:", path)

0 comments on commit 04fbdc3

Please sign in to comment.