|
10 | 10 | from pandas.io import data as web |
11 | 11 | from pandas.io.data import DataReader, SymbolWarning |
12 | 12 | from pandas.util.testing import (assert_series_equal, assert_produces_warning, |
13 | | - network) |
| 13 | + network, assert_frame_equal) |
14 | 14 | from numpy.testing import assert_array_equal |
15 | 15 |
|
16 | 16 |
|
@@ -139,12 +139,20 @@ def test_get_components_dax(self): |
139 | 139 |
|
140 | 140 | @network |
141 | 141 | def test_get_components_nasdaq_100(self): |
| 142 | + """as of 7/12/13 the conditional will test false because the link is |
| 143 | + invalid""" |
142 | 144 | df = web.get_components_yahoo('^NDX') #NASDAQ-100 |
143 | 145 | assert isinstance(df, pd.DataFrame) |
144 | | - # Usual culprits, should be around for a while |
145 | | - assert 'AAPL' in df.index |
146 | | - assert 'GOOG' in df.index |
147 | | - assert 'AMZN' in df.index |
| 146 | + |
| 147 | + if len(df) > 1: |
| 148 | + # Usual culprits, should be around for a while |
| 149 | + assert 'AAPL' in df.index |
| 150 | + assert 'GOOG' in df.index |
| 151 | + assert 'AMZN' in df.index |
| 152 | + else: |
| 153 | + expected = DataFrame({'exchange': 'N/A', 'name': '@^NDX'}, |
| 154 | + index=['@^NDX']) |
| 155 | + assert_frame_equal(df, expected) |
148 | 156 |
|
149 | 157 | @network |
150 | 158 | def test_get_data_single_symbol(self): |
|
0 commit comments