@@ -117,6 +117,7 @@ def test_get_multi2(self):
117
117
self .assertEqual ((4 , 3 ), result .shape )
118
118
assert_n_failed_equals_n_null_columns (w , result )
119
119
120
+ @network
120
121
def test_dtypes (self ):
121
122
#GH3995, #GH8980
122
123
data = web .get_data_google ('F' , start = 'JAN-01-10' , end = 'JAN-27-13' )
@@ -126,6 +127,13 @@ def test_dtypes(self):
126
127
assert np .issubdtype (data .High .dtype , np .number )
127
128
assert np .issubdtype (data .Volume .dtype , np .number )
128
129
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
+
129
137
class TestYahoo (tm .TestCase ):
130
138
@classmethod
131
139
def setUpClass (cls ):
@@ -366,34 +374,45 @@ def test_get_all_data_calls_only(self):
366
374
self .assertTrue (len (data ) > 1 )
367
375
368
376
@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
+
369
388
def test_sample_page_price_quote_time1 (self ):
370
389
#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 ) ))
374
393
375
394
def test_chop (self ):
376
395
#regression test for #7625
377
396
self .aapl .chop_data (self .data1 , above_below = 2 , underlying_price = np .nan )
378
397
chopped = self .aapl .chop_data (self .data1 , above_below = 2 , underlying_price = 100 )
379
- self .assertIsInstance ( chopped , DataFrame )
398
+ self .assert_ ( isinstance ( chopped , DataFrame ) )
380
399
self .assertTrue (len (chopped ) > 1 )
381
400
382
401
def test_chop_out_of_strike_range (self ):
383
402
#regression test for #7625
384
403
self .aapl .chop_data (self .data1 , above_below = 2 , underlying_price = np .nan )
385
404
chopped = self .aapl .chop_data (self .data1 , above_below = 2 , underlying_price = 100000 )
386
- self .assertIsInstance ( chopped , DataFrame )
405
+ self .assert_ ( isinstance ( chopped , DataFrame ) )
387
406
self .assertTrue (len (chopped ) > 1 )
388
407
389
408
390
409
@network
391
410
def test_sample_page_price_quote_time2 (self ):
392
411
#Tests the EDT page format
393
412
#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 ) ))
397
416
398
417
@network
399
418
def test_sample_page_chg_float (self ):
0 commit comments