kmadac / bitstamp-python-client

Python package to communicate with bitstamp.net
MIT License
143 stars 70 forks source link

Tests fail (public_client.py) #7

Closed certik closed 10 years ago

certik commented 10 years ago

The public API tests fail for me:

$ python public_client.py
E.{u'sell': u'1.3629', u'buy': u'1.3740'}
{u'timestamp': u'1390948125', u'bids': [[u'796.01', u'3.27353428'], [u'796.00', u'0.09854665'], [u'795.76', u'0.08796622'], [u'795.51', u'0.05028221'], [u'795.01', u'0.05660306'], [u'795.00', u'0.09867060'], [u'794.76', u'0.06291207'], [u'794.00', u'0.09879487'], [u'793.00', u'0.09891946'], [u'792.39', u'0.03700000'], [u'792.35', u'5.90000000'], [u'792.34', u'2.00000000'], [u'792.30', 
[I skipped lots of lines]
e': u'791.54', u'amount': u'0.07650000'}, {u'date': u'1390944620', u'tid': 3266288, u'price': u'791.38', u'amount': u'0.19043545'}, {u'date': u'1390944608', u'tid': 3266287, u'price': u'791.38', u'amount': u'0.10100000'}.
======================================================================
ERROR: test_bitinstant_reserves (__main__.bitstamp_public_TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "public_client.py", line 27, in test_bitinstant_reserves
    bitinstant_reserves = self.client.bitinstant_reserves()
  File "/nh/nest/u/ondrej/repos/hashstack2/x2/lib/python2.7/site-packages/bitstamp/client.py", line 56, in bitinstant_reserves
    r.raise_for_status()
  File "/nh/nest/u/ondrej/repos/hashstack2/x2/lib/python2.7/site-packages/requests/models.py", line 773, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
HTTPError: 404 Client Error: NOT FOUND

----------------------------------------------------------------------
Ran 5 tests in 6.071s

FAILED (errors=1)
SmileyChris commented 10 years ago

The bitinstant_reserves call should be removed - it isn't part of their published API any longer

As an aside, in my opinion the tests should just be mocking the Bitstamp API rather than live calls.

(My fork does both test mocking and removes the bitinstant_reserves call... happy to have it merged back this way ;))

certik commented 10 years ago

@SmileyChris -- thanks! You should create a PR with your changes. I was about to submit a PEP 8 PR as well, but I can see you already fixed it.

SmileyChris commented 10 years ago

Yeah, i should. Done in #8

kmadac commented 10 years ago

Because PR #8 was merged to master where bitinstant_reserves is removed, I'm closing this issue.