New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unittest 總是遇到 AssertError #97
Comments
我想嘗試先更新 self.assertCountEqual(
mock.get_stock_info('2330').keys(),
['msgArray', 'referer', 'userDelay', 'rtcode', 'queryTime', 'rtmessage', 'exKey', 'cachedAlive']) |
self.assertEqual(s['realtime']['latest_trade_price'], '214.50')
self.assertEqual(s['realtime']['best_bid_price'],
['214.00', '213.50', '213.00', '212.50', '212.00']) 這部分我想改成 # match 100 ~ 999
self.assertRegex(s['realtime']['latest_trade_price'], "[0-9]{3}\.[0-9]+")
for index in range(5):
# match 100 ~ 999
self.assertRegex(s['realtime']['best_bid_price'][index], "[0-9]{3}\.[0-9]+") |
LorneWu
added a commit
to LorneWu/twstock
that referenced
this issue
Oct 11, 2021
Fixed in #125, thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unittest 總是遇到 AssertError
我看起來是
'http://mis.twse.com.tw/stock/api/getStockInfo.jsp?ex_ch={stock_id}&_={time}'
api 格式有變原先是
dict_keys(['msgArray', 'userDelay', 'rtmessage', 'referer', 'queryTime', 'rtcode'])
後來新增了一些欄位
dict_keys(['msgArray', 'referer', 'userDelay', 'rtcode', 'queryTime', 'rtmessage', 'exKey', 'cachedAlive'])
所以導致
Reference link :
https://travis-ci.org/github/mlouielu/twstock/jobs/764044874
https://travis-ci.org/github/mlouielu/twstock/jobs/772273350
The text was updated successfully, but these errors were encountered: