Skip to content

TST: Fix tests in TestGoogle #9839

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

Merged
merged 1 commit into from
Apr 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pandas/io/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def assert_n_failed_equals_n_null_columns(wngs, obj, cls=SymbolWarning):
all_nan_cols = pd.Series(dict((k, pd.isnull(v).all()) for k, v in
compat.iteritems(obj)))
n_all_nan_cols = all_nan_cols.sum()
valid_warnings = pd.Series([wng for wng in wngs if isinstance(wng, cls)])
valid_warnings = pd.Series([wng for wng in wngs if wng.category == cls])
assert_equal(len(valid_warnings), n_all_nan_cols)
failed_symbols = all_nan_cols[all_nan_cols].index
msgs = valid_warnings.map(lambda x: x.message)
Expand Down Expand Up @@ -79,18 +79,18 @@ def test_get_goog_volume(self):
for locale in self.locales:
with tm.set_locale(locale):
df = web.get_data_google('GOOG').sort_index()
self.assertEqual(df.Volume.ix['OCT-08-2010'], 2863473)
self.assertEqual(df.Volume.ix['JAN-02-2015'], 1446662)

@network
def test_get_multi1(self):
for locale in self.locales:
sl = ['AAPL', 'AMZN', 'GOOG']
with tm.set_locale(locale):
pan = web.get_data_google(sl, '2012')
ts = pan.Close.GOOG.index[pan.Close.AAPL > pan.Close.GOOG]
ts = pan.Close.GOOG.index[pan.Close.AAPL < pan.Close.GOOG]
if (hasattr(pan, 'Close') and hasattr(pan.Close, 'GOOG') and
hasattr(pan.Close, 'AAPL')):
self.assertEqual(ts[0].dayofyear, 96)
self.assertEqual(ts[0].dayofyear, 3)
else:
self.assertRaises(AttributeError, lambda: pan.Close)

Expand Down Expand Up @@ -135,7 +135,7 @@ def test_dtypes(self):
def test_unicode_date(self):
#GH8967
data = web.get_data_google('F', start='JAN-01-10', end='JAN-27-13')
self.assertEquals(data.index.name, 'Date')
self.assertEqual(data.index.name, 'Date')


class TestYahoo(tm.TestCase):
Expand Down