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 RobinHood #7

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

Fix RobinHood #7

Zapata opened this issue Aug 8, 2019 · 1 comment

Comments

@Zapata
Copy link
Owner

Zapata commented Aug 8, 2019

____________________________________________________ test_robinhood_equities_fetch ____________________________________________________

checkers = <class 'conftest.Checkers'>

    def test_robinhood_equities_fetch(checkers):
        source = RobinHood(equities=['F:USD', 'BABA:USD'], aliases={'F':'FORDCOM', 'BABA':'ALIBABACOM'})
        feed = source.fetch()
>       checkers.check_feed(feed, ['FORDCOM:USD', 'ALIBABACOM:USD'], noVolume=True)

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

feed = {}, pairs = ['FORDCOM:USD', 'ALIBABACOM:USD'], kargs = {'noVolume': True}, pair = 'FORDCOM:USD', quote = 'FORDCOM', base = 'USD'
@py_assert1 = False, @py_format3 = "'USD' in {}", @py_format5 = "assert 'USD' 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 'USD' in {}

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

RobinHood 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/robinhood.py", line 23, in _fetch
    result = response.json()['results']
  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

Robinhood API now need a Robinhood account, that need a full KYC and to be an US citizen.

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