• aszlig's avatar
    tests: Don't mock received_message_hashes · 46a19733
    aszlig authored
    This fixes the following two test cases from TestChatControlSession in
    test/unit/test_sessions.py:
    
     * test_receive_1nocontrol
     * test_receive_2already_has_control
    
    The MockConnection object already defines various attributes from the
    real Connection object to their corresponding types so that calling code
    is able to for example iterate on dicts or lists.
    
    Since 40a3f80a, there exists a new
    received_message_hashes attribute, which is expected to be a list but
    the default Mock object doesn't define an __iter__ method.
    
    So this leads to the following exception:
    
    Traceback (most recent call last):
      File ".../share/gajim/src/common/ged.py", line 93, in raise_event
        if handler(*args, **kwargs):
      File ".../share/gajim/src/common/connection_handlers.py", line 1137, in _nec_message_received
        conn=self, msg_obj=obj))
      File ".../share/gajim/src/common/nec.py", line 74, in push_incoming_event
        if event_object.generate():
      File ".../share/gajim/src/common/connection_handlers_events.py", line 1468, in generate
        if self.msghash in self.conn.received_message_hashes:
    TypeError: argument of type 'instance' is not iterable
    
    Defining received_message_hashes to be a list fixes this.
    Signed-off-by: aszlig's avataraszlig <aszlig@redmoonstudios.org>
    46a19733
Name
Last commit
Last update
data Loading commit data...
debian Loading commit data...
doc Loading commit data...
icons Loading commit data...
m4 Loading commit data...
plugins Loading commit data...
po Loading commit data...
scripts Loading commit data...
src Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
INSTALL Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
THANKS Loading commit data...
THANKS.artists Loading commit data...
appveyor.yml Loading commit data...
autogen.sh Loading commit data...
build.bat Loading commit data...
configure.ac Loading commit data...
dependencys.ps1 Loading commit data...
gajim-portable.nsi Loading commit data...
gajim.nsi Loading commit data...
launch.bat Loading commit data...
launch.sh Loading commit data...
requirements.txt Loading commit data...
setup_win32.py Loading commit data...