Skip to content

Commit

Permalink
feat(test): setup test
Browse files Browse the repository at this point in the history
  • Loading branch information
philloooo committed Feb 27, 2018
1 parent 9fc4e09 commit 6789f3d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ sudo: false

install:
- "pip install . --force --upgrade"
- "pip install -r test-requirements.txt"

script: "py.test -vv tests"
4 changes: 4 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pytest==3.0.6
-e git+https://github.com/uc-cdis/cdisutils-test.git@feat/indexd#egg=cdisutilstest
-e git+https://github.com/uc-cdis/[email protected]#egg=cdispyutils
-e git+https://github.com/uc-cdis/[email protected]#egg=indexd
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pytest

from cdisutilstest.code.indexd_fixture import indexd_server
from indexclient.client import IndexClient


@pytest.fixture
def index_client(indexd_server):
yield IndexClient(
baseurl=indexd_server.baseurl, auth=indexd_server.auth)
9 changes: 9 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def test_instantiate(index_client):
hashes = {'md5': 'ab167e49d25b488939b1ede42752458b'}
doc = index_client.create(
hashes=hashes,
size=5,
urls=[]
)
assert doc.size == 5
assert doc.hashes == hashes

0 comments on commit 6789f3d

Please sign in to comment.