1- import pytest
2-
3- import pandas .util .testing as tm
1+ from datetime import datetime
42
3+ import pytest
54from pandas import DataFrame
6- from datetime import datetime , timedelta
5+
76from pandas_datareader .data import (DataReader , get_summary_iex , get_last_iex ,
87 get_dailysummary_iex , get_iex_symbols ,
98 get_iex_book )
@@ -25,8 +24,10 @@ def test_historical(self):
2524
2625 def test_false_ticker (self ):
2726 df = get_last_iex ("INVALID TICKER" )
28- tm . assert_frame_equal ( df , DataFrame ())
27+ assert df . shape [ 0 ] == 0
2928
29+ @pytest .mark .xfail (reason = 'IEX daily history API is returning 500 as of '
30+ 'Jan 2018' )
3031 def test_daily (self ):
3132 df = get_dailysummary_iex (start = datetime (2017 , 5 , 5 ),
3233 end = datetime (2017 , 5 , 6 ))
@@ -43,6 +44,5 @@ def test_live_prices(self):
4344 assert df ["price" ].mean () > 0
4445
4546 def test_deep (self ):
46- dob = get_iex_book ('GS' , service = 'system-event' )
47- assert len (dob ['eventResponse' ]) > 0
48- assert dob ['timestamp' ] > datetime .now () - timedelta (days = 1 )
47+ dob = get_iex_book ('GS' , service = 'book' )
48+ assert 'GS' in dob
0 commit comments