LanceMaverick / skybeard-2

The omniscient telegram bot is back. Now in python 3 and based on a plug-in system
Other
6 stars 4 forks source link

'NoneType' returned in Test Debug Only test #141

Closed artemis-beta closed 7 years ago

artemis-beta commented 7 years ago

See the results from the CircleCI tests.

Traceback (most recent call last):
  File "/home/ubuntu/skybeard-2/tests/test_decorators.py", line 35, in test_debugonly_return_None
    self.loop.run_until_complete(foo_coro)
  File "/opt/circleci/python/3.6.0/lib/python3.6/asyncio/base_events.py", line 466, in run_until_complete
    return future.result()
  File "/home/ubuntu/skybeard-2/skybeard/decorators/debugonly.py", line 34, in g
    await beard.sender.sendMessage(
AttributeError: 'NoneType' object has no attribute 'sender'
LanceMaverick commented 7 years ago

Cannot use NoneType when decorator needs access to beard member functions and variables. Created a TestBeard and TestSender class in test_decorators.py, (see https://github.com/LanceMaverick/skybeard-2/commit/79a76f40e805e50ccdda6e3e7b76a1cb37eaf957) however, we might want to separate this so that it can be expanded on and other tests can use it in the future.