Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Commit

Permalink
Added coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapz committed Mar 3, 2014
1 parent 55bd922 commit fb78663
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ language: python

install: "pip install -r requirements.txt"

script: "py.test test_cryptsy.py -v"
script:
- coverage run --source=Cryptsy.py -m py.test test_cryptsy.py -v
- coverage report -m

after_script:
- coveralls --verbose
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ so be warned, here be dragons.
[![Dependency Status](https://gemnasium.com/jaapz/CryptsyPythonAPI.png)](https://gemnasium.com/jaapz/CryptsyPythonAPI)
[![Build Status](https://api.travis-ci.org/jaapz/CryptsyPythonAPI.png)](https://travis-ci.org/jaapz/CryptsyPythonAPI)
[![PyPI Version](https://pypip.in/v/Cryptsy/badge.png)](https://pypi.python.org/pypi/Cryptsy)
[![Coverage Status](https://coveralls.io/repos/jaapz/CryptsyPythonAPI/badge.png)](https://coveralls.io/r/jaapz/CryptsyPythonAPI)

Author's Note
-------------
Expand Down Expand Up @@ -57,6 +58,10 @@ Then, using pytest, run the tests:

py.test test_cryptsy.py

Or with coverage reports:

py.test --cov Cryptsy.py test_cryptsy.py

Development
----------
Development is done in the obviously named develop branch. If you want to
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
PyYAML==3.10
argparse==1.2.1
cov-core==1.7
coverage==3.7.1
coveralls==0.4.1
distribute==0.7.3
docopt==0.6.1
mock==1.0.1
py==1.4.20
pytest==2.5.2
pytest-cov==1.6
requests==2.2.1
wsgiref==0.1.2
15 changes: 6 additions & 9 deletions test_cryptsy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,14 @@ def test_cryptsy_init():
assert instance.SECRET == 'Secret'


class TestPublicApiCall:
""" Some requests are done to the "public" API of cryptsy. """
def test_method_should_be_added_in_the_url(mock_urlopen, api):
rv = api._public_api_query('testmethod')
assert rv['url'] == 'http://pubapi.cryptsy.com/api.php?method=testmethod'

def test_method_should_be_added_in_the_url(self, mock_urlopen, api):
rv = api._public_api_query('testmethod')
assert rv['url'] == 'http://pubapi.cryptsy.com/api.php?method=testmethod'

def test_marketid_should_be_added_as_get_parameter(self, mock_urlopen,
api):
rv = api._public_api_query('testmethod', marketid=10)
assert rv['url'] == 'http://pubapi.cryptsy.com/api.php?method=testmethod&marketid=10'
def test_marketid_should_be_added_as_get_parameter(mock_urlopen, api):
rv = api._public_api_query('testmethod', marketid=10)
assert rv['url'] == 'http://pubapi.cryptsy.com/api.php?method=testmethod&marketid=10'


@pytest.fixture
Expand Down

0 comments on commit fb78663

Please sign in to comment.