Exemplo n.º 1
0
 def test_get_all_alignment_new(self):
     """ Compare bulk 'all_info' values to individual values.
     Currently broken due to misalignment from invalid CSV in
     fields: f6, k3, and maybe j2, a5, b6.
     """
     symbol = 'GOOG'
     all_info = quote_properties.get_all(symbol)
     self.assertIsInstance(all_info, dict)
     self.assertEquals(
         all_info['PreviousClose'],
         ystockquote.get_previous_close(symbol))
     self.assertEquals(
         all_info['Volume'],
         ystockquote.get_volume(symbol))
     self.assertEquals(
         all_info['BidRealtime'],
         ystockquote.get_bid_realtime(symbol))
     self.assertEquals(
         all_info['AskRealtime'],
         ystockquote.get_ask_realtime(symbol))
     self.assertEquals(
         all_info['LastTradePriceOnly'],
         ystockquote.get_last_trade_price(symbol))
     self.assertEquals(
         all_info['Open'],
         ystockquote.get_today_open(symbol))
     self.assertEquals(
         all_info['DaysHigh'],
         ystockquote.get_todays_high(symbol))
     self.assertEquals(
         all_info['LastTradeDate'],
         ystockquote.get_last_trade_date(symbol))
Exemplo n.º 2
0
 def test_get_all_alignment(self):
     """ Compare bulk 'all_info' values to individual values.
     Currently broken due to misalignment from invalid CSV in
     fields: f6, k3, and maybe j2, a5, b6.
     """
     symbol = 'GOOG'
     all_info = ystockquote.get_all(symbol)
     self.assertIsInstance(all_info, dict)
     self.assertEquals(
         all_info['previous_close'],
         ystockquote.get_previous_close(symbol))
     self.assertEquals(
         all_info['volume'],
         ystockquote.get_volume(symbol))
     self.assertEquals(
         all_info['bid_realtime'],
         ystockquote.get_bid_realtime(symbol))
     self.assertEquals(
         all_info['ask_realtime'],
         ystockquote.get_ask_realtime(symbol))
     self.assertEquals(
         all_info['last_trade_price'],
         ystockquote.get_last_trade_price(symbol))
     self.assertEquals(
         all_info['today_open'],
         ystockquote.get_today_open(symbol))
     self.assertEquals(
         all_info['todays_high'],
         ystockquote.get_todays_high(symbol))
     self.assertEquals(
         all_info['last_trade_date'],
         ystockquote.get_last_trade_date(symbol))
Exemplo n.º 3
0
def task_listener(gearman_worker, gearman_job):
    decoded = json.loads(gearman_job.data)
    price = ystockquote.get_bid_realtime(decoded['symbol'])
    return price.encode("ascii")
Exemplo n.º 4
0
def task_listener(gearman_worker, gearman_job):
    decoded = json.loads(gearman_job.data)
    price = ystockquote.get_bid_realtime(decoded['symbol'])
    return price.encode("ascii")
Exemplo n.º 5
0
import ystockquote


while True:
	symbol = raw_input("Please input stock symbol:")
	print(ystockquote.get_price_book(symbol))
	print(ystockquote.get_bid_realtime(symbol))
	print ystockquote.get_historical_prices(symbol, '2013-12-01', '2013-12-10')
Exemplo n.º 6
0
import ystockquote

while True:
    symbol = raw_input("Please input stock symbol:")
    print(ystockquote.get_price_book(symbol))
    print(ystockquote.get_bid_realtime(symbol))
    print ystockquote.get_historical_prices(symbol, '2013-12-01', '2013-12-10')