Beispiel #1
0
def quote_factory(_, row):
    """Converts row to quote"""
    symbol, expiration, date, time, close = row
    expiration = database.decode_date(expiration)
    date = database.decode_date(date)
    time = database.decode_time(time)
    return FutureQuote(symbol, expiration, date, time, close)
Beispiel #2
0
def quote_factory(_, row):
    """Converts row to quote"""
    symbol, type_, expiration, strike, date, time, \
        bid, ask, stock, iv_bid, iv_ask = row
    expiration = database.decode_date(expiration)
    date = database.decode_date(date)
    time = database.decode_time(time)
    return OptionQuote(symbol, type_, expiration, strike, date, time,
        bid, ask, stock, iv_bid, iv_ask)
Beispiel #3
0
 def test_time_none(self):
     self.assertIsNone(database.encode_time(None))
     self.assertIsNone(database.decode_time(None))
Beispiel #4
0
 def test_time(self):
     time = datetime.time(18, 55)
     self.assertEqual(database.decode_time(database.encode_time(time)), time)