From a73c2f198def7bae7f70ffe0cb824539f4a065fd Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Sun, 21 Jul 2013 12:11:13 -0400 Subject: [PATCH] TST: make sure test passes even if componnents link isn't present --- pandas/io/tests/test_data.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pandas/io/tests/test_data.py b/pandas/io/tests/test_data.py index 849f79afe3855..e760ddff518f5 100644 --- a/pandas/io/tests/test_data.py +++ b/pandas/io/tests/test_data.py @@ -10,7 +10,7 @@ from pandas.io import data as web from pandas.io.data import DataReader, SymbolWarning from pandas.util.testing import (assert_series_equal, assert_produces_warning, - network) + network, assert_frame_equal) from numpy.testing import assert_array_equal @@ -139,12 +139,20 @@ def test_get_components_dax(self): @network def test_get_components_nasdaq_100(self): + """as of 7/12/13 the conditional will test false because the link is + invalid""" df = web.get_components_yahoo('^NDX') #NASDAQ-100 assert isinstance(df, pd.DataFrame) - # Usual culprits, should be around for a while - assert 'AAPL' in df.index - assert 'GOOG' in df.index - assert 'AMZN' in df.index + + if len(df) > 1: + # Usual culprits, should be around for a while + assert 'AAPL' in df.index + assert 'GOOG' in df.index + assert 'AMZN' in df.index + else: + expected = DataFrame({'exchange': 'N/A', 'name': '@^NDX'}, + index=['@^NDX']) + assert_frame_equal(df, expected) @network def test_get_data_single_symbol(self):