From 9ef7a18350963d1016f0b84849a19333386f89a7 Mon Sep 17 00:00:00 2001 From: Kaushik Ghose Date: Thu, 17 Sep 2020 17:00:27 -0400 Subject: [PATCH] Add test for pulling --- .github/workflows/tests.yml | 3 +++ tests/test_pulling.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/test_pulling.py diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c7c405..61d6a99 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,6 +29,9 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest + env: + SB_AUTH_TOKEN: ${{ secrets.API_KEY }} + SB_API_ENDPOINT: https://api.sbgenomics.com/v2 run: | pip install pytest cd tests diff --git a/tests/test_pulling.py b/tests/test_pulling.py new file mode 100644 index 0000000..f441beb --- /dev/null +++ b/tests/test_pulling.py @@ -0,0 +1,13 @@ +import subprocess +import pathlib +import tempfile + + +def test_pull(): + + with tempfile.TemporaryDirectory() as td: + out_dir = pathlib.Path(td) + subprocess.run(["sbpull", "--unpack", ".", "admin/sbg-public-data/eqtl-analysis-with-fastqtl-gtex-v7/", str(out_dir / "eqtl.cwl")], check=True) + + assert (out_dir / "eqtl.cwl").exists() + assert (out_dir / "eqtl.cwl.steps").exists()