cant test the bot using test.py
Opened this issue · 0 comments
I have been trying to check the bot response using test.py file and getting this error but when I run the main.py this error never appears.
C:\Users\DeathStar\Dropbox\Server keys\Monitors & Traders\Git Files\mcafee2cash>pipenv run python test.py
Test: get_coins_bittrex passed
Test: extract_symbols passed
Test: get_sentiment_analysis passed
Test: get_verdict passed
Test: analyze passed
482598433
Running bot...
Test: telegram_summary passed
482598433
Running bot...
Traceback (most recent call last):
File "C:\Users\DeathStar.virtualenvs\mcafee2cash-8uNjmB4s\lib\site-packages\telepot\loop.py", line 60, in run_forever
allowed_updates=allowed_updates)
File "C:\Users\DeathStar.virtualenvs\mcafee2cash-8uNjmB4s\lib\site-packages\telepot_init_.py", line 993, in getUpdates
return self._api_request('getUpdates', rectify(p))
File "C:\Users\DeathStar.virtualenvs\mcafee2cash-8uNjmB4s\lib\site-packages\telepot_init.py", line 491, in _api_request
return api.request((self._token, method, params, files), **kwargs)
File "C:\Users\DeathStar.virtualenvs\mcafee2cash-8uNjmB4s\lib\site-packages\telepot\api.py", line 155, in request
return _parse(r)
File "C:\Users\DeathStar.virtualenvs\mcafee2cash-8uNjmB4s\lib\site-packages\telepot\api.py", line 150, in parse
raise exception.TelegramError(description, error_code, data)
telepot.exception.TelegramError: ('Conflict: terminated by other long poll or webhook', 409, {'ok': False, 'error_code': 409, 'description': 'Conflict: terminated by other long poll or webhook'})
Traceback (most recent call last):
File "C:\Users\DeathStar.virtualenvs\mcafee2cash-8uNjmB4s\lib\site-packages\telepot\loop.py", line 60, in run_forever
allowed_updates=allowed_updates)
File "C:\Users\DeathStar.virtualenvs\mcafee2cash-8uNjmB4s\lib\site-packages\telepot_init.py", line 993, in getUpdates
return self._api_request('getUpdates', rectify(p))
File "C:\Users\DeathStar.virtualenvs\mcafee2cash-8uNjmB4s\lib\site-packages\telepot_init.py", line 491, in _api_request
return api.request((self._token, method, params, files), **kwargs)
Test: telegram_buy failed
File "C:\Users\DeathStar.virtualenvs\mcafee2cash-8uNjmB4s\lib\site-packages\telepot\api.py", line 155, in request
return _parse(r)
File "C:\Users\DeathStar.virtualenvs\mcafee2cash-8uNjmB4s\lib\site-packages\telepot\api.py", line 150, in _parse
raise exception.TelegramError(description, error_code, data)
Traceback (most recent call last):
telepot.exception.TelegramError: ('Conflict: terminated by other long poll or webhook', 409, {'ok': False, 'error_code': 409, 'description': 'Conflict: terminated by other long poll or webhook'})
File "test.py", line 118, in test_telegram_buy
replies = main.bot.get_query_replies(query_data)
File "C:\Users\DeathStar\Dropbox\Server keys\Monitors & Traders\Git Files\mcafee2cash\telegram.py", line 158, in get_query_replies
replies.append((f'Send me an amount in BTC or /cancel ({self.bittrex_utils.get_available_balance("BTC")} BTC available)', None))
File "C:\Users\DeathStar\Dropbox\Server keys\Monitors & Traders\Git Files\mcafee2cash\bittrex_utils.py", line 37, in get_available_balance
return self.my_bittrex.get_balance(symbol)["result"]["Available"]
TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test.py", line 195, in
raise e
File "test.py", line 192, in
test_queuetest_name
File "test.py", line 123, in test_telegram_buy
raise AssertionError(e)
AssertionError: 'NoneType' object is not subscriptable