diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..91cad96 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +language: python + +python: + - "3.5" + - "3.6" + +before_install: + - sudo apt-get -qq update + - sudo apt-get install -y ncbi-blast+ prodigal + - wget http://github.com/bbuchfink/diamond/releases/download/v0.9.18/diamond-linux64.tar.gz + - tar xzf diamond-linux64.tar.gz + - sudo mv diamond /usr/bin + +install: + - pip install -r requirements.txt + - pip install . + +script: + - ./test.sh diff --git a/requirements.txt b/requirements.txt index 29abca2..79f0964 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,5 @@ -requests==2.18.2 +biopython>=1.60 +filetype>=1.0.0 +pytest>=3.0.0 +mock>=2.0.0 +pandas>=0.15.0 diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..14e9c7c --- /dev/null +++ b/test.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# run unit tests for RGI + +# get latest card database +wget -O card_data.tar.bz2 https://card.mcmaster.ca/latest/data +mkdir -p card_data +tar xvf card_data.tar.bz2 -C card_data + +# load rgi +rgi load -i card_data/card.json + +# for test_1.py +cp card_data/card.json app/_data + +# for test_3.py +cp card_data/card.json tests/input + +# run unit tests +cd tests +pytest -v -rxs + +# exit with the exitcode thrown by pytest +exit $?