Skip to content
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

Fix indentation in labhub_test.py #550

Closed
wants to merge 4 commits into from
Closed

Conversation

KlebGomes
Copy link

issue #543

@TravisBuddy
Copy link

Travis tests have failed

Hey @KlebGomes,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Copy link
Member

@nvzard nvzard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please read the commit guideline and change you commit according to that.

labhub.REPOS['repository.github.io'].create_issue.assert_called_with(
'another title', 'and body\nOpened by @None at [text]()'
)
labhub.REPOS['repository.github.io'].create_issue.assert_called_with('another title', 'and body\nOpened by @None at [text]()')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the line length at most 80 characters.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok!

Copy link
Member

@jayvdb jayvdb Jun 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nvzard , why didnt CI pick this up? Please create an issue about that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done #565


testbot.assertCommand('!invite meetto newcomers',
'Command "invite" / "invite meetto" not found.')
testbot.assertCommand('!invite meetto newcomers', 'Command "invite" / "invite meetto" not found.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line length 80 chars and just correct the indentation. Eg:

 testbot.assertCommand('!invite meetto newcomers',
                       'Command "invite" / "invite meetto" not found.')

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok!

Copy link
Member

@jayvdb jayvdb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes requested

@gitmate-bot gitmate-bot added size/L and removed size/M labels Jun 16, 2018
@TravisBuddy
Copy link

Travis tests have failed

Hey @KlebGomes,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

1st Build

python -m pytest
============================= test session starts ==============================
platform linux -- Python 3.6.3, pytest-3.3.0, py-1.5.2, pluggy-0.6.0
rootdir: /home/travis/build/coala/corobo, inifile: setup.cfg
plugins: requests-mock-1.5.0, cov-2.5.1
collected 37 items                                                             

tests/answer_test.py .                                                   [  2%]
tests/ban_test.py ..                                                     [  8%]
tests/coala_lowercase_c_test.py ..                                       [ 13%]
tests/coatils_test.py ...........                                        [ 43%]
tests/deprecate_bot_prefixes_test.py .                                   [ 45%]
tests/explain_test.py .                                                  [ 48%]
tests/ghetto_test.py .                                                   [ 51%]
tests/git_stats_test.py .                                                [ 54%]
tests/labhub_test.py ...FFF..                                            [ 75%]
tests/lmgtfy_test.py .                                                   [ 78%]
tests/nevermind_test.py .                                                [ 81%]
tests/pitchfork_test.py .                                                [ 83%]
tests/searchdocs_test.py .                                               [ 86%]
tests/ship_it_test.py .                                                  [ 89%]
tests/spam_test.py ..                                                    [ 94%]
tests/the_rules_test.py .                                                [ 97%]
tests/wolfram_alpha_test.py .                                            [100%]

----------- coverage: platform linux, python 3.6.3-final-0 -----------
Name                                Stmts   Miss  Cover   Missing
-----------------------------------------------------------------
plugins/__init__.py                     0      0   100%
plugins/answer.py                      25      0   100%
plugins/ban.py                         37      0   100%
plugins/coala_lowercase_c.py           12      0   100%
plugins/coatils.py                    120      0   100%
plugins/constants.py                    7      0   100%
plugins/deprecate_bot_prefixes.py       6      0   100%
plugins/explain.py                     21      0   100%
plugins/ghetto.py                      10      0   100%
plugins/git_stats.py                   51      0   100%
plugins/labhub.py                     212     17    92%   102, 106-112, 115-141, 193, 345-349
plugins/lmgtfy.py                       4      0   100%
plugins/nevermind.py                    5      0   100%
plugins/pitchfork.py                   12      0   100%
plugins/searchdocs.py                  16      0   100%
plugins/ship_it.py                      7      0   100%
plugins/spam.py                        20      0   100%
plugins/the_rules.py                    5      0   100%
plugins/wolfram_alpha.py               18      0   100%
-----------------------------------------------------------------
TOTAL                                 588     17    97%

FAIL Required test coverage of 100% not reached. Total coverage: 97.11%

=================================== FAILURES ===================================
_____________________ TestLabHub.test_hello_world_callback _____________________

self = <tests.labhub_test.TestLabHub testMethod=test_hello_world_callback>

    def test_hello_world_callback(self):
        teams = {'coala newcomers': self.mock_team, }
    
        testbot = TestBot(extra_plugin_dir='plugins', loglevel=logging.ERROR)
        testbot.start()
        labhub = testbot.bot.plugin_manager.get_plugin_obj_by_name('LabHub')
        labhub.TEAMS = teams
        self.mock_team.is_member.return_value = False
        testbot.assertCommand('hello, world', 'newcomer')
        # Since the user won't be invited again, it'll timeout waiting for a
        # response.
        with self.assertRaises(queue.Empty):
            testbot.assertCommand('helloworld', 'newcomer')
>       self.mock_team.invite.assert_called_with(None)

tests/labhub_test.py:78: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

_mock_self = <MagicMock name='mock.invite' spec='function' id='139817089320272'>
args = (None,), kwargs = {}, expected = 'invite(None)'

    def assert_called_with(_mock_self, *args, **kwargs):
        """assert that the mock was called with the specified arguments.
    
            Raises an AssertionError if the args and keyword args passed in are
            different to the last call to the mock."""
        self = _mock_self
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
>           raise AssertionError('Expected call: %s\nNot called' % (expected,))
E           AssertionError: Expected call: invite(None)
E           Not called

/opt/python/3.6.3/lib/python3.6/unittest/mock.py:805: AssertionError
----------------------------- Captured stdout call -----------------------------
ERROR    errbot.plugins.LabHub     Cannot create github object, please check GH_TOKEN
ERROR    backoff                   Giving up get_response(...) after 1 tries (RuntimeError: ('{"message":"Requires authentication","documentation_url":"https://developer.github.com/v3/repos/#list-your-repositories"}', 401))
ERROR    errbot.plugins.LabHub     Something went wrong in fetching github repos.
Traceback (most recent call last):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 48, in __init__
    self.IGH.write_repositories)}
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/GitHub/GitHub.py", line 71, in write_repositories
    repo_list = get(self._token, '/user/repos')
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/GitHub/__init__.py", line 223, in get
    headers=headers)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/Interfaces/__init__.py", line 140, in _fetch
    resp = get_response(method, base_url + url, json=data)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/backoff/_sync.py", line 85, in retry
    ret = target(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/backoff/_sync.py", line 85, in retry
    ret = target(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/Interfaces/__init__.py", line 106, in get_response
    raise RuntimeError(response.text, response.status_code)
RuntimeError: ('{"message":"Requires authentication","documentation_url":"https://developer.github.com/v3/repos/#list-your-repositories"}', 401)
waiting on queue
message received
ERROR    errbot.core               callback_message on deprecate_bot_prefixes crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/deprecate_bot_prefixes.py", line 15, in callback_message
    for deprecated_prefix in self.bot_config.BOT_DEPRECATED_PREFIXES:
AttributeError: 'ShallowConfig' object has no attribute 'BOT_DEPRECATED_PREFIXES'
waiting on queue
message received
ERROR    errbot.core               callback_message on deprecate_bot_prefixes crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/deprecate_bot_prefixes.py", line 15, in callback_message
    for deprecated_prefix in self.bot_config.BOT_DEPRECATED_PREFIXES:
AttributeError: 'ShallowConfig' object has no attribute 'BOT_DEPRECATED_PREFIXES'
ERROR    errbot.core               callback_message on git_stats crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 153, in callback_message
    if (not self.TEAMS[self.GH_ORG_NAME + ' newcomers'].is_member(user)
KeyError: 'coala newcomers'
waiting on queue
message received
ERROR    errbot.core               callback_message on deprecate_bot_prefixes crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/deprecate_bot_prefixes.py", line 15, in callback_message
    for deprecated_prefix in self.bot_config.BOT_DEPRECATED_PREFIXES:
AttributeError: 'ShallowConfig' object has no attribute 'BOT_DEPRECATED_PREFIXES'
ERROR    errbot.core               callback_message on git_stats crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 153, in callback_message
    if (not self.TEAMS[self.GH_ORG_NAME + ' newcomers'].is_member(user)
KeyError: 'coala newcomers'
waiting on queue
----------------------------- Captured stderr call -----------------------------
2018-06-16 10:34:34,851 ERROR    errbot.plugins.LabHub     Cannot create github object, please check GH_TOKEN
2018-06-16 10:34:34,999 ERROR    backoff                   Giving up get_response(...) after 1 tries (RuntimeError: ('{"message":"Requires authentication","documentation_url":"https://developer.github.com/v3/repos/#list-your-repositories"}', 401))
2018-06-16 10:34:35,000 ERROR    errbot.plugins.LabHub     Something went wrong in fetching github repos.
Traceback (most recent call last):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 48, in __init__
    self.IGH.write_repositories)}
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/GitHub/GitHub.py", line 71, in write_repositories
    repo_list = get(self._token, '/user/repos')
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/GitHub/__init__.py", line 223, in get
    headers=headers)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/Interfaces/__init__.py", line 140, in _fetch
    resp = get_response(method, base_url + url, json=data)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/backoff/_sync.py", line 85, in retry
    ret = target(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/backoff/_sync.py", line 85, in retry
    ret = target(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/Interfaces/__init__.py", line 106, in get_response
    raise RuntimeError(response.text, response.status_code)
RuntimeError: ('{"message":"Requires authentication","documentation_url":"https://developer.github.com/v3/repos/#list-your-repositories"}', 401)
2018-06-16 10:34:35,320 ERROR    errbot.core               callback_message on deprecate_bot_prefixes crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/deprecate_bot_prefixes.py", line 15, in callback_message
    for deprecated_prefix in self.bot_config.BOT_DEPRECATED_PREFIXES:
AttributeError: 'ShallowConfig' object has no attribute 'BOT_DEPRECATED_PREFIXES'
2018-06-16 10:34:35,324 ERROR    errbot.core               callback_message on deprecate_bot_prefixes crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/deprecate_bot_prefixes.py", line 15, in callback_message
    for deprecated_prefix in self.bot_config.BOT_DEPRECATED_PREFIXES:
AttributeError: 'ShallowConfig' object has no attribute 'BOT_DEPRECATED_PREFIXES'
2018-06-16 10:34:35,329 ERROR    errbot.core               callback_message on git_stats crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 153, in callback_message
    if (not self.TEAMS[self.GH_ORG_NAME + ' newcomers'].is_member(user)
KeyError: 'coala newcomers'
2018-06-16 10:34:35,331 ERROR    errbot.core               callback_message on deprecate_bot_prefixes crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/deprecate_bot_prefixes.py", line 15, in callback_message
    for deprecated_prefix in self.bot_config.BOT_DEPRECATED_PREFIXES:
AttributeError: 'ShallowConfig' object has no attribute 'BOT_DEPRECATED_PREFIXES'
2018-06-16 10:34:35,332 ERROR    errbot.core               callback_message on git_stats crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 153, in callback_message
    if (not self.TEAMS[self.GH_ORG_NAME + ' newcomers'].is_member(user)
KeyError: 'coala newcomers'
------------------------------ Captured log call -------------------------------
labhub.py                   31 ERROR    Cannot create github object, please check GH_TOKEN
_common.py                  89 ERROR    Giving up get_response(...) after 1 tries (RuntimeError: ('{"message":"Requires authentication","documentation_url":"https://developer.github.com/v3/repos/#list-your-repositories"}', 401))
labhub.py                   50 ERROR    Something went wrong in fetching github repos.
Traceback (most recent call last):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 48, in __init__
    self.IGH.write_repositories)}
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/GitHub/GitHub.py", line 71, in write_repositories
    repo_list = get(self._token, '/user/repos')
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/GitHub/__init__.py", line 223, in get
    headers=headers)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/Interfaces/__init__.py", line 140, in _fetch
    resp = get_response(method, base_url + url, json=data)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/backoff/_sync.py", line 85, in retry
    ret = target(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/backoff/_sync.py", line 85, in retry
    ret = target(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/IGitt/Interfaces/__init__.py", line 106, in get_response
    raise RuntimeError(response.text, response.status_code)
RuntimeError: ('{"message":"Requires authentication","documentation_url":"https://developer.github.com/v3/repos/#list-your-repositories"}', 401)
core.py                    116 ERROR    callback_message on deprecate_bot_prefixes crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/deprecate_bot_prefixes.py", line 15, in callback_message
    for deprecated_prefix in self.bot_config.BOT_DEPRECATED_PREFIXES:
AttributeError: 'ShallowConfig' object has no attribute 'BOT_DEPRECATED_PREFIXES'
core.py                    116 ERROR    callback_message on deprecate_bot_prefixes crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/deprecate_bot_prefixes.py", line 15, in callback_message
    for deprecated_prefix in self.bot_config.BOT_DEPRECATED_PREFIXES:
AttributeError: 'ShallowConfig' object has no attribute 'BOT_DEPRECATED_PREFIXES'
core.py                    116 ERROR    callback_message on git_stats crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 153, in callback_message
    if (not self.TEAMS[self.GH_ORG_NAME + ' newcomers'].is_member(user)
KeyError: 'coala newcomers'
core.py                    116 ERROR    callback_message on deprecate_bot_prefixes crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/deprecate_bot_prefixes.py", line 15, in callback_message
    for deprecated_prefix in self.bot_config.BOT_DEPRECATED_PREFIXES:
AttributeError: 'ShallowConfig' object has no attribute 'BOT_DEPRECATED_PREFIXES'
core.py                    116 ERROR    callback_message on git_stats crashed
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 114, in _dispatch_to_plugins
    getattr(plugin, method)(*args, **kwargs)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 153, in callback_message
    if (not self.TEAMS[self.GH_ORG_NAME + ' newcomers'].is_member(user)
KeyError: 'coala newcomers'
__________________________ TestLabHub.test_invite_cmd __________________________

self = <tests.labhub_test.TestLabHub testMethod=test_invite_cmd>

    def test_invite_cmd(self):
        teams = {
            'coala maintainers': self.mock_team,
            'coala newcomers': self.mock_team,
            'coala developers': self.mock_team
        }
    
        labhub, testbot = plugin_testbot(plugins.labhub.LabHub, logging.ERROR)
        labhub.activate()
        labhub._teams = teams
    
        self.mock_team.is_member.return_value = True
        plugins.labhub.os.environ['GH_TOKEN'] = 'patched?'
        testbot.assertCommand('!invite meet to developers',
>                             '@meet, you are a part of developers')

tests/labhub_test.py:53: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <errbot.backends.test.TestBot object at 0x7f29a8a77f98>
command = '!invite meet to developers'
response = '@meet, you are a part of developers', timeout = 5

    def assertCommand(self, command, response, timeout=5):
        """Assert the given command returns the given response"""
        self.bot.push_message(command)
        msg = self.bot.pop_message(timeout)
>       assert response in msg, "'{}' not in '{}'".format(response, msg)
E       AssertionError: '@meet, you are a part of developers' not in 'Computer says nooo. See logs for details:
E        'TestPerson' object has no attribute 'room''

../../../virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/backends/test.py:457: AssertionError
----------------------------- Captured stdout call -----------------------------
DEBUG    errbot.backends.test      Merging {} to the bot config.
waiting on queue
message received
waiting on queue
message received
waiting on queue
ERROR    errbot.core               An error happened while processing a message ("!invite meet to developers"): Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
"
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
----------------------------- Captured stderr call -----------------------------
2018-06-16 10:34:40,845 DEBUG    errbot.backends.test      Merging {} to the bot config.
2018-06-16 10:34:41,092 ERROR    errbot.core               An error happened while processing a message ("!invite meet to developers"): Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
"
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
------------------------------ Captured log call -------------------------------
test.py                    371 DEBUG    Merging {} to the bot config.
core.py                    476 ERROR    An error happened while processing a message ("!invite meet to developers"): Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
"
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
__________________________ TestLabHub.test_invite_me ___________________________

self = <tests.labhub_test.TestLabHub testMethod=test_invite_me>

    def test_invite_me(self):
        teams = {
            'coala maintainers': self.mock_team,
            'coala newcomers': self.mock_team,
            'coala developers': self.mock_team
        }
    
        labhub, testbot = plugin_testbot(plugins.labhub.LabHub, logging.ERROR)
        labhub.activate()
        labhub._teams = teams
    
        plugins.labhub.os.environ['GH_TOKEN'] = 'patched?'
>       testbot.assertCommand('!invite me', 'We\'ve just sent you an invite')

tests/labhub_test.py:337: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <errbot.backends.test.TestBot object at 0x7f299d5b4ac8>
command = '!invite me', response = "We've just sent you an invite", timeout = 5

    def assertCommand(self, command, response, timeout=5):
        """Assert the given command returns the given response"""
        self.bot.push_message(command)
        msg = self.bot.pop_message(timeout)
>       assert response in msg, "'{}' not in '{}'".format(response, msg)
E       AssertionError: 'We've just sent you an invite' not in 'Computer says nooo. See logs for details:
E        'TestPerson' object has no attribute 'room''

../../../virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/backends/test.py:457: AssertionError
----------------------------- Captured stdout call -----------------------------
DEBUG    errbot.backends.test      Merging {} to the bot config.
waiting on queue
message received
waiting on queue
message received
waiting on queue
ERROR    errbot.core               An error happened while processing a message ("!invite me"): Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
"
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
----------------------------- Captured stderr call -----------------------------
2018-06-16 10:34:41,446 DEBUG    errbot.backends.test      Merging {} to the bot config.
2018-06-16 10:34:41,691 ERROR    errbot.core               An error happened while processing a message ("!invite me"): Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
"
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
------------------------------ Captured log call -------------------------------
test.py                    371 DEBUG    Merging {} to the bot config.
core.py                    476 ERROR    An error happened while processing a message ("!invite me"): Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
"
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/errbot/core.py", line 459, in _execute_and_send
    reply = method(msg, match) if match else method(msg, args)
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 114, in invite_cmd
    if not self.is_room_member(invitee, msg):
  File "/home/travis/build/coala/corobo/plugins/labhub.py", line 77, in is_room_member
    return invitee in msg.frm.room.occupants
AttributeError: 'TestPerson' object has no attribute 'room'
=============================== warnings summary ===============================
None
  Module already imported so can not be re-written: errbot.backends.test

tests/labhub_test.py::TestBot
  cannot collect test class 'TestBot' because it has a __init__ constructor

tests/spam_test.py::TestBot
  cannot collect test class 'TestBot' because it has a __init__ constructor

-- Docs: http://doc.pytest.org/en/latest/warnings.html
============== 3 failed, 34 passed, 3 warnings in 118.40 seconds ===============

@jayvdb
Copy link
Member

jayvdb commented Jun 16, 2018

You have four commits in https://github.com/coala/corobo/pull/550/commits

We require one. It should be properly rebased. Using git command line. See http://coala.io/commit

@jayvdb
Copy link
Member

jayvdb commented Aug 11, 2018

https://github.com/coala/corobo/pull/550/files now does something very different.

Also the issue is now stale due to other merged improvements.

Closing.

@jayvdb jayvdb closed this Aug 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants