Skip to content

Commit

Permalink
RLS 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
addisonlynch committed Feb 21, 2019
1 parent 635173b commit ed19e39
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
5 changes: 1 addition & 4 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Account
Stocks
------

.. seealso:: For more information, see `Stocks <stocks.html>`__.
.. seealso:: For more information, see :ref:`Stocks<stocks>`.



Expand Down Expand Up @@ -127,9 +127,6 @@ or for a ``pandas.DataFrame`` indexed by each minute:
Endpoints
~~~~~~~~~

The Stock endpoints of the `IEX Developer
API <https://iextrading.com/developer/>`__ are below, each of which
contains data regarding a different aspect of the security/securities.
The ``Stock`` object can obtain each
of these endpoints. Requests for single symbols will return the *exact* results
from that endpoint as shown in the IEX API documentation (see below). Requests
Expand Down
8 changes: 5 additions & 3 deletions docs/source/whatsnew/v0.4.0.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. _whatsnew_040:


v0.4.0 (TBA)
-------------------------
v0.4.0 (2/21/2019)
------------------

This is a major release from 0.3.0, and we recommend that all users
This is a major release from 0.3.5, and we recommend that all users
update.


Expand Down Expand Up @@ -86,6 +86,8 @@ Backwards Incompatible Changes
- ``iexfinance.stocks.get_todays_earnings`` deprecated and renamed ``get_earnings_today``
- ``iexfinance.stocks.get_relevant`` deprecated and renamed
``get_relevant_stocks``
- ``iexfinance.stocks.get_all`` is now available for the Version 1.0 Developer
API only.

.. whatsnew_040.bug_fixes:

Expand Down
2 changes: 2 additions & 0 deletions iexfinance/stocks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from iexfinance.base import _IEXBase
from iexfinance.utils import _handle_lists, no_pandas, cloud_endpoint
from iexfinance.utils.exceptions import IEXSymbolError, IEXEndpointError
from iexfinance.utils import legacy_endpoint


class Stock(_IEXBase):
Expand Down Expand Up @@ -45,6 +46,7 @@ def __init__(self, symbols=None, **kwargs):
self.endpoints = []
super(Stock, self).__init__(**kwargs)

@legacy_endpoint
def get_all(self):
"""
Returns all endpoints, indexed by endpoint title for each symbol
Expand Down
11 changes: 8 additions & 3 deletions iexfinance/tests/test_stocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,21 @@ def setup_class(self):
json_parse_float=Decimal)
self.cshare5 = Stock("gig^")

@pytest.mark.xfail(reason="Unstable / errored IEX cloud endpoint.")
@pytest.mark.xfail(reason="Unstable.")
@pytest.mark.legacy
def test_invalid_symbol(self):
data = Stock("BAD SYMBOL")
with pytest.raises(IEXSymbolError):
data.get_price()

@pytest.mark.xfail(reason="Unsable / errored IEX cloud endpoint.")
@pytest.mark.xfail(reason="Unstable")
@pytest.mark.legacy
def test_get_all_format(self):
data = self.cshare.get_all()
assert isinstance(data, dict)

@pytest.mark.xfail(reason="Unsable / errored IEX cloud endpoint.")
@pytest.mark.xfail(reason="Unstable.")
@pytest.mark.legacy
def test_get_all(self):
data = self.cshare.get_all()
assert len(data) == 20
Expand Down Expand Up @@ -341,11 +344,13 @@ def test_get_endpoints_bad_endpoint(self):
with pytest.raises(IEXEndpointError):
self.cbatch.get_endpoints("BAD ENDPOINT")

@pytest.mark.legacy
def test_get_all(self):
data = self.cbatch.get_all()
assert len(data) == 2
assert len(data["AAPL"]) == 20

@pytest.mark.legacy
def test_get_all_format(self):
data = self.cbatch.get_all()
assert isinstance(data, dict)
Expand Down

0 comments on commit ed19e39

Please sign in to comment.