Codaone / DEXBot

Trading Bot for the BitShares Decentralized Exchange
Other
247 stars 127 forks source link

BitsharesPriceFeed Unit Test #592

Open thehapax opened 5 years ago

bitProfessor commented 5 years ago

https://github.com/bitProfessor/DEXBot/tree/devel/tests/pricefeeds hi @thehapax ,#592 It looks like three test cases failed. I'm not sure why. Can you see?

thehapax commented 5 years ago

Which 3 test cases failed?

bitProfessor commented 5 years ago

http://htmlpreview.github.io/?https://github.com/bitProfessor/DEXBot/blob/devel/tests/pricefeeds/report.html @thehapax

thehapax commented 5 years ago

The error " AssertionError: assert 'BTS' != 'BTS'" should not happen if the other tests pass. I still cannot see the updates on your master branch, so i don't have any code to reference except your unit test. It should, however, match the code from the most recent Codaone/devel which is here:

https://github.com/Codaone/DEXBot/blob/devel/dexbot/pricefeeds/bitshares_feed.py

thehapax commented 5 years ago

For starters you have != instead of ==. In buy orders you have ==, whereas in sell orders you have != In your unit test:

 def test_get_market_buy_orders(self):
        buy_orders = self.pf.get_market_buy_orders(depth=10)
        for o in buy_orders:
            assert o['base']['symbol'] == self.market['base']['symbol']

    def test_get_market_sell_orders(self):
        sell_orders = self.pf.get_market_sell_orders(depth=10)
        for o in sell_orders:
            assert o['base']['symbol'] != self.market['base']['symbol']
bitProfessor commented 5 years ago

1、fixed it. 2、I bought a new computer and I'm switching. git pull later

bitProfessor commented 5 years ago

hi @thehapax : 1、I tested it with 2 input data:USD:BTS,CNY:BTS 2、All passed the test (USD:BTS ) http://htmlpreview.github.io/?https://github.com/bitProfessor/DEXBot/blob/dev/tests/pricefeeds/usd_bts_report.html 3、5 failed, 9 passed(CNY:BTS) http://htmlpreview.github.io/?https://github.com/bitProfessor/DEXBot/blob/dev/tests/pricefeeds/cny_bts_report.html

bitProfessor commented 5 years ago

hi @thehapax : 1、in docker : http://htmlpreview.github.io/?https://github.com/bitProfessor/DEXBot/blob/dev/tests/pricefeeds/doocker_report.html 2、Maybe it's py-bitshares's problem.

bitphage commented 5 years ago

@bitProfessor yes, this https://github.com/bitshares/python-bitshares/issues/234#issuecomment-502697543

Update your tests to devel branch where shared instance is used, this solves the problem.

bitProfessor commented 5 years ago

Thaks

Professor

bitprofessor@163.com | 签名由网易邮箱大师定制

On 06/17/2019 22:08,Vladimir Kamarzinnotifications@github.com wrote:

@bitProfessor yes, this bitshares/python-bitshares#234 (comment)

Update your tests to devel branch where shared instance is used, this solves the problem.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

thehapax commented 5 years ago

Hi bitProfessor, happy to see this complete. what branch is it on? (don't see a pull)