Skip to content

Commit

Permalink
Merge pull request #15 from peshay/new-tests
Browse files Browse the repository at this point in the history
Use functional testing based on API documentation
  • Loading branch information
peshay authored Dec 16, 2017
2 parents fa8b3ba + cda2118 commit 0311293
Show file tree
Hide file tree
Showing 4 changed files with 403 additions and 154 deletions.
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[![Build Status](https://travis-ci.org/peshay/btcde.svg?branch=master)](https://travis-ci.org/peshay/btcde)
[![Codecov](https://codecov.io/gh/peshay/btcde/branch/master/graph/badge.svg)](https://codecov.io/gh/peshay/btcde/branch/master)
[![Scrutinizer](https://scrutinizer-ci.com/g/peshay/btcde/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/peshay/btcde/?branch=master)
[![Build Status](https://travis-ci.org/peshay/btcde.svg?branch=new-test)](https://travis-ci.org/peshay/btcde)
[![Codecov](https://codecov.io/gh/peshay/btcde/branch/new-test/graph/badge.svg)](https://codecov.io/gh/peshay/btcde/branch/new-test)
[![Scrutinizer](https://scrutinizer-ci.com/g/peshay/btcde/badges/quality-score.png?b=new-test)](https://scrutinizer-ci.com/g/peshay/btcde/?branch=new-test)
[![Python version](https://img.shields.io/pypi/pyversions/btcde.svg)](https://pypi.python.org/pypi/btcde)
[![license](https://img.shields.io/github/license/peshay/btcde.svg)](https://github.com/peshay/btcde/blob/master/LICENSE)
[![license](https://img.shields.io/github/license/peshay/btcde.svg)](https://github.com/peshay/btcde/blob/new-test/LICENSE)
[![Beerpay](https://beerpay.io/peshay/btcde/badge.svg?style=beer)](https://beerpay.io/peshay/btcde)

# btcde.py
Expand Down Expand Up @@ -90,8 +90,3 @@ All mandatory parameters have to be passed to a function, all optional are resol
#### showAccountLedger(conn, **args)

*API Credits Cost: 3*

## Support on Beerpay
Hey dude! Help me out for a couple of :beers:!

[![Beerpay](https://beerpay.io/peshay/btcde/badge.svg?style=beer-square)](https://beerpay.io/peshay/btcde) [![Beerpay](https://beerpay.io/peshay/btcde/make-wish.svg?style=flat-square)](https://beerpay.io/peshay/btcde?focus=wish)
17 changes: 10 additions & 7 deletions btcde.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def set_header(conn, url, method, encoded_string):
'X-API-NONCE': str(nonce),
'X-API-SIGNATURE': hmac_signed }
return header

def send_request(url, method, header, encoded_string):
if method == 'GET':
r = requests.get(url, headers=(header),
Expand All @@ -110,7 +110,7 @@ def send_request(url, method, header, encoded_string):
r = requests.delete(url, headers=(header),
stream=True, verify=False)
return r

def APIConnect(conn, method, params, uri):
"""Transform Parameters to URL"""
url, encoded_string = params_url(params, uri)
Expand Down Expand Up @@ -150,7 +150,7 @@ def createOrder(conn, OrderType, trading_pair, max_amount, price, **args):
def deleteOrder(conn, order_id, trading_pair):
"""Delete an Order."""
newuri = orderuri + "/" + order_id + "/" + trading_pair
params = {'order_id': order_id, 'trading_pair': trading_pair}
params = {}
return APIConnect(conn, 'DELETE', params, newuri)


Expand All @@ -163,7 +163,7 @@ def showMyOrders(conn, **args):
def showMyOrderDetails(conn, order_id):
"""Details to an own Order."""
newuri = orderuri + '/' + order_id
params = {'order_id': order_id}
params = {}
return APIConnect(conn, 'GET', params, newuri)


Expand All @@ -182,7 +182,7 @@ def showMyTrades(conn, **args):
def showMyTradeDetails(conn, trade_id):
"""Details to a specific Trade."""
newuri = tradeuri + '/' + trade_id
params = {'trade_id': trade_id}
params = {}
return APIConnect(conn, 'GET', params, newuri)


Expand Down Expand Up @@ -214,6 +214,9 @@ def showRates(conn, trading_pair):
return APIConnect(conn, 'GET', params, newuri)


def showAccountLedger(conn, **args):
def showAccountLedger(conn, currency, **args):
"""Query on Account statement."""
return APIConnect(conn, 'GET', args, accounturi + '/ledger')
params = {'currency': currency}
params.update(args)
args.update()
return APIConnect(conn, 'GET', params, accounturi + '/ledger')
135 changes: 0 additions & 135 deletions tests/test_btcde.py

This file was deleted.

Loading

0 comments on commit 0311293

Please sign in to comment.