13
13
from pandas .io .data import DataReader , SymbolWarning
14
14
from pandas .util .testing import (assert_series_equal , assert_produces_warning ,
15
15
network , assert_frame_equal )
16
+ import pandas .util .testing as tm
16
17
from numpy .testing import assert_array_equal
17
18
18
19
@@ -44,9 +45,9 @@ def test_google(self):
44
45
start = datetime (2010 , 1 , 1 )
45
46
end = datetime (2013 , 1 , 27 )
46
47
47
- self . assertEquals (
48
- web .DataReader ("F" , 'google' , start , end )[ 'Close' ][ - 1 ],
49
- 13.68 )
48
+ with tm . set_locale ( 'en_US.UTF-8' ):
49
+ panel = web .DataReader ("F" , 'google' , start , end )
50
+ self . assertEquals ( panel . Close [ - 1 ], 13.68 )
50
51
51
52
self .assertRaises (Exception , web .DataReader , "NON EXISTENT TICKER" ,
52
53
'google' , start , end )
@@ -58,13 +59,15 @@ def test_get_quote_fails(self):
58
59
59
60
@network
60
61
def test_get_goog_volume (self ):
61
- df = web .get_data_google ('GOOG' )
62
+ with tm .set_locale ('en_US.UTF-8' ):
63
+ df = web .get_data_google ('GOOG' ).sort_index ()
62
64
self .assertEqual (df .Volume .ix ['OCT-08-2010' ], 2863473 )
63
65
64
66
@network
65
67
def test_get_multi1 (self ):
66
68
sl = ['AAPL' , 'AMZN' , 'GOOG' ]
67
- pan = web .get_data_google (sl , '2012' )
69
+ with tm .set_locale ('en_US.UTF-8' ):
70
+ pan = web .get_data_google (sl , '2012' )
68
71
69
72
def testit ():
70
73
ts = pan .Close .GOOG .index [pan .Close .AAPL > pan .Close .GOOG ]
@@ -79,8 +82,9 @@ def testit():
79
82
@network
80
83
def test_get_multi2 (self ):
81
84
with warnings .catch_warnings (record = True ) as w :
82
- pan = web .get_data_google (['GE' , 'MSFT' , 'INTC' ], 'JAN-01-12' ,
83
- 'JAN-31-12' )
85
+ with tm .set_locale ('en_US.UTF-8' ):
86
+ pan = web .get_data_google (['GE' , 'MSFT' , 'INTC' ], 'JAN-01-12' ,
87
+ 'JAN-31-12' )
84
88
result = pan .Close .ix ['01-18-12' ]
85
89
assert_n_failed_equals_n_null_columns (w , result )
86
90
0 commit comments