@@ -117,6 +117,7 @@ def test_get_multi2(self):
117117 self .assertEqual ((4 , 3 ), result .shape )
118118 assert_n_failed_equals_n_null_columns (w , result )
119119
120+ @network
120121 def test_dtypes (self ):
121122 #GH3995, #GH8980
122123 data = web .get_data_google ('F' , start = 'JAN-01-10' , end = 'JAN-27-13' )
@@ -126,6 +127,13 @@ def test_dtypes(self):
126127 assert np .issubdtype (data .High .dtype , np .number )
127128 assert np .issubdtype (data .Volume .dtype , np .number )
128129
130+ @network
131+ def test_unicode_date (self ):
132+ #GH8967
133+ data = web .get_data_google ('F' , start = 'JAN-01-10' , end = 'JAN-27-13' )
134+ self .assertEquals (data .index .name , 'Date' )
135+
136+
129137class TestYahoo (tm .TestCase ):
130138 @classmethod
131139 def setUpClass (cls ):
@@ -366,34 +374,45 @@ def test_get_all_data_calls_only(self):
366374 self .assertTrue (len (data ) > 1 )
367375
368376 @network
377+ def test_get_underlying_price (self ):
378+ #GH7
379+ try :
380+ options_object = web .Options ('^spxpm' , 'yahoo' )
381+ url = options_object ._yahoo_url_from_expiry (options_object .expiry_dates [0 ])
382+ root = options_object ._parse_url (url )
383+ quote_price = options_object ._underlying_price_from_root (root )
384+ except RemoteDataError as e :
385+ raise nose .SkipTest (e )
386+ self .assert_ (isinstance (quote_price , float ))
387+
369388 def test_sample_page_price_quote_time1 (self ):
370389 #Tests the weekend quote time format
371- price , quote_time = self .aapl ._get_underlying_price (self .html1 )
372- self .assertIsInstance ( price , (int , float , complex ))
373- self .assertIsInstance ( quote_time , (datetime , Timestamp ))
390+ price , quote_time = self .aapl ._underlying_price_and_time_from_url (self .html1 )
391+ self .assert_ ( isinstance ( price , (int , float , complex ) ))
392+ self .assert_ ( isinstance ( quote_time , (datetime , Timestamp ) ))
374393
375394 def test_chop (self ):
376395 #regression test for #7625
377396 self .aapl .chop_data (self .data1 , above_below = 2 , underlying_price = np .nan )
378397 chopped = self .aapl .chop_data (self .data1 , above_below = 2 , underlying_price = 100 )
379- self .assertIsInstance ( chopped , DataFrame )
398+ self .assert_ ( isinstance ( chopped , DataFrame ) )
380399 self .assertTrue (len (chopped ) > 1 )
381400
382401 def test_chop_out_of_strike_range (self ):
383402 #regression test for #7625
384403 self .aapl .chop_data (self .data1 , above_below = 2 , underlying_price = np .nan )
385404 chopped = self .aapl .chop_data (self .data1 , above_below = 2 , underlying_price = 100000 )
386- self .assertIsInstance ( chopped , DataFrame )
405+ self .assert_ ( isinstance ( chopped , DataFrame ) )
387406 self .assertTrue (len (chopped ) > 1 )
388407
389408
390409 @network
391410 def test_sample_page_price_quote_time2 (self ):
392411 #Tests the EDT page format
393412 #regression test for #8741
394- price , quote_time = self .aapl ._get_underlying_price (self .html2 )
395- self .assertIsInstance ( price , (int , float , complex ))
396- self .assertIsInstance ( quote_time , (datetime , Timestamp ))
413+ price , quote_time = self .aapl ._underlying_price_and_time_from_url (self .html2 )
414+ self .assert_ ( isinstance ( price , (int , float , complex ) ))
415+ self .assert_ ( isinstance ( quote_time , (datetime , Timestamp ) ))
397416
398417 @network
399418 def test_sample_page_chg_float (self ):
0 commit comments