Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coincap #3

Open
Zapata opened this issue Aug 8, 2019 · 1 comment
Open

Fix coincap #3

Zapata opened this issue Aug 8, 2019 · 1 comment

Comments

@Zapata
Copy link
Owner

Zapata commented Aug 8, 2019

_________________________________________________________ test_coincap_fetch __________________________________________________________

checkers = <class 'conftest.Checkers'>

    def test_coincap_fetch(checkers):
        source = Coincap(quotes=['ALTCAP', 'ALTCAP.X'], bases=['BTC'])
        feed = source.fetch()
>       checkers.check_feed(feed, ['ALTCAP:BTC', 'ALTCAP.X:BTC'], noVolume=True)

tests/sources/test_coincap.py:6: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

feed = {}, pairs = ['ALTCAP:BTC', 'ALTCAP.X:BTC'], kargs = {'noVolume': True}, pair = 'ALTCAP:BTC', quote = 'ALTCAP', base = 'BTC'
@py_assert1 = False, @py_format3 = "'BTC' in {}", @py_format5 = "assert 'BTC' in {}"

    @staticmethod
    def check_feed(feed, pairs, **kargs):
        print(feed)
        for pair in pairs:
            (quote, base) = pair.split(':')
>           assert base in feed
E           AssertionError: assert 'BTC' in {}

tests/sources/conftest.py:9: AssertionError
-------------------------------------------------------- Captured stdout call ---------------------------------------------------------

Coincap encountered an error while loading live data.
{}
-------------------------------------------------------- Captured stderr call ---------------------------------------------------------
Traceback (most recent call last):
  File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/main.py", line 65, in fetch
    feed = self._fetch() # pylint: disable=no-member
  File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/coincap.py", line 14, in _fetch
    coincap_front = requests.get('http://www.coincap.io/front').json()
  File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@Zapata
Copy link
Owner Author

Zapata commented Aug 11, 2019

Needs to move to Coincap v2.
Total rewrite needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant