diff --git a/.github/workflows/poetry.yml b/.github/workflows/poetry.yml index b2a6be4..71c0b5b 100644 --- a/.github/workflows/poetry.yml +++ b/.github/workflows/poetry.yml @@ -26,3 +26,5 @@ jobs: run: poetry run black --check --verbose . - name: Isort check run: poetry run isort . --check --diff + - name: Pytest check + run: poetry run pytest -rP diff --git a/tests/test_kcidev.py b/tests/test_kcidev.py new file mode 100644 index 0000000..48c0631 --- /dev/null +++ b/tests/test_kcidev.py @@ -0,0 +1,40 @@ +from subprocess import PIPE, run +import os + + +def test_prepare(): + os.system("cp .kci-dev.toml.example .kci-dev.toml") + assert os.path.exists(".kci-dev.toml") + + +def test_kcidev_help(): + command = ["poetry", "run", "kci-dev", "--help"] + result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True) + print("returncode: " + str(result.returncode)) + print("#### stdout ####") + print(result.stdout) + print("#### stderr ####") + print(result.stderr) + assert result.returncode == 0 + + +def test_kcidev_commit_help(): + command = ["poetry", "run", "kci-dev", "commit", "--help"] + result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True) + print("returncode: " + str(result.returncode)) + print("#### stdout ####") + print(result.stdout) + print("#### stderr ####") + print(result.stderr) + assert result.returncode == 0 + + +def test_kcidev_patch_help(): + command = ["poetry", "run", "kci-dev", "patch", "--help"] + result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True) + print("returncode: " + str(result.returncode)) + print("#### stdout ####") + print(result.stdout) + print("#### stderr ####") + print(result.stderr) + assert result.returncode == 0