def test_realtime_get_raw(self): realtime.proxies_list = [] responses.add(responses.GET, 'http://mis.twse.com.tw/stock/index.jsp', status=200) responses.add(responses.GET, self.FETCH_URL['2330'], json=twstock.mock.get_stock_info('2330'), status=200) stock = realtime.get_raw('2330') self.assertIn('msgArray', stock)
def test_realtime_field(self): realtime.proxies_list = [] responses.add(responses.GET, 'http://mis.twse.com.tw/stock/index.jsp', status=200) responses.add(responses.GET, self.FETCH_URL['2330'], json=twstock.mock.get_stock_info('2330'), status=200) stock = realtime.get_raw('2330') self.assertCountEqual(stock.keys(), twstock.mock.get_stock_info('2330').keys())
def test_realtime_field(self): self.assertCountEqual( realtime.get_raw('2330').keys(), twstock.mock.get_stock_info('2330').keys())
def test_realtime_get_raw(self): self.assertIn('msgArray', realtime.get_raw('2330'))