Skip to content

Commit fb78663

Browse files
committed
Added coveralls
1 parent 55bd922 commit fb78663

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ language: python
66

77
install: "pip install -r requirements.txt"
88

9-
script: "py.test test_cryptsy.py -v"
9+
script:
10+
- coverage run --source=Cryptsy.py -m py.test test_cryptsy.py -v
11+
- coverage report -m
12+
13+
after_script:
14+
- coveralls --verbose

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ so be warned, here be dragons.
99
[![Dependency Status](https://gemnasium.com/jaapz/CryptsyPythonAPI.png)](https://gemnasium.com/jaapz/CryptsyPythonAPI)
1010
[![Build Status](https://api.travis-ci.org/jaapz/CryptsyPythonAPI.png)](https://travis-ci.org/jaapz/CryptsyPythonAPI)
1111
[![PyPI Version](https://pypip.in/v/Cryptsy/badge.png)](https://pypi.python.org/pypi/Cryptsy)
12+
[![Coverage Status](https://coveralls.io/repos/jaapz/CryptsyPythonAPI/badge.png)](https://coveralls.io/r/jaapz/CryptsyPythonAPI)
1213

1314
Author's Note
1415
-------------
@@ -57,6 +58,10 @@ Then, using pytest, run the tests:
5758

5859
py.test test_cryptsy.py
5960

61+
Or with coverage reports:
62+
63+
py.test --cov Cryptsy.py test_cryptsy.py
64+
6065
Development
6166
----------
6267
Development is done in the obviously named develop branch. If you want to

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
PyYAML==3.10
12
argparse==1.2.1
23
cov-core==1.7
34
coverage==3.7.1
5+
coveralls==0.4.1
46
distribute==0.7.3
7+
docopt==0.6.1
58
mock==1.0.1
69
py==1.4.20
710
pytest==2.5.2
811
pytest-cov==1.6
12+
requests==2.2.1
913
wsgiref==0.1.2

test_cryptsy.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,14 @@ def test_cryptsy_init():
3333
assert instance.SECRET == 'Secret'
3434

3535

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

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

43-
def test_marketid_should_be_added_as_get_parameter(self, mock_urlopen,
44-
api):
45-
rv = api._public_api_query('testmethod', marketid=10)
46-
assert rv['url'] == 'http://pubapi.cryptsy.com/api.php?method=testmethod&marketid=10'
41+
def test_marketid_should_be_added_as_get_parameter(mock_urlopen, api):
42+
rv = api._public_api_query('testmethod', marketid=10)
43+
assert rv['url'] == 'http://pubapi.cryptsy.com/api.php?method=testmethod&marketid=10'
4744

4845

4946
@pytest.fixture

0 commit comments

Comments
 (0)