コード例 #1
0
 def test_find_options_by_strike(self):
     info = r.find_options_by_strike(self.symbol, self.strike)
     assert (len(info) >= 24)
     info = r.find_options_by_strike(self.symbol, self.strike, 'call')
     assert (info[0]['type'] == 'call')
     info = r.find_options_by_strike(self.symbol,
                                     self.strike,
                                     info='expiration_date')
     assert (len(set(info)) > 1)
     info = r.find_options_by_strike(self.symbol,
                                     self.strike,
                                     info='strike_price')
     assert (len(set(info)) == 1)
コード例 #2
0
 def test_find_options_by_strike(self):
     info = r.find_options_by_strike(self.symbol, self.strike)
     self.assertGreater(len(info), 30)
     info = r.find_options_by_strike(self.symbol, self.strike, 'call')
     self.assertEqual(info[0]['type'], 'call')
     info = r.find_options_by_strike(self.symbol,
                                     self.strike,
                                     info='expiration_date')
     self.assertGreater(len(set(info)), 1)
     info = r.find_options_by_strike(self.symbol,
                                     self.strike,
                                     info='strike_price')
     self.assertEqual(len(set(info)), 1)