Skip to content

Commit 9512451

Browse files
committed
Added first test and pytest as a requirement
1 parent b63859d commit 9512451

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.env/
2+
__pycache__/
3+
*.pyc
4+
*.pyo

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ print(Exchange.createOrder(26, "Buy", 100, 0.00000001)) # Buy 100 dgc at .
1717
print(Exchange.cancelMarketOrders(26)) # Cancels all orders in market 26, dgc
1818
```
1919

20+
Running the tests
21+
-----------------
22+
If you want to run the tests, first create a virtualenv and install all
23+
requirements.
24+
25+
virtualenv .env
26+
. .env/bin/activate
27+
pip install -r requirements.txt
28+
29+
Then, using pytest, run the tests:
30+
31+
py.test test_cryptsy.py
32+
2033
License
2134
-------
2235
This piece of software is licensed under the GPL2 license, see `license`.

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
argparse==1.2.1
2+
distribute==0.7.3
3+
py==1.4.20
4+
pytest==2.5.2
5+
wsgiref==0.1.2

test_cryptsy.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from Cryptsy import Cryptsy as API
2+
3+
4+
def test_cryptsy_init():
5+
""" The Cryptsy class constructor should accept the API Key and the Secret
6+
in the constructor and set it on the instance. """
7+
instance = API('API Key', 'Secret')
8+
assert instance.APIKey == 'API Key'
9+
assert instance.Secret == 'Secret'

0 commit comments

Comments
 (0)