Philipp Hörist pushed to branch mainwindow at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/common/modules/__init__.py
    ... ... @@ -20,7 +20,6 @@
    20 20
     import sys
    
    21 21
     import logging
    
    22 22
     from importlib import import_module
    
    23
    -from unittest.mock import MagicMock
    
    24 23
     
    
    25 24
     from gajim.common.types import ConnectionT
    
    26 25
     
    
    ... ... @@ -91,28 +90,6 @@
    91 90
     ]  # type: List[str]
    
    92 91
     
    
    93 92
     
    
    94
    -class ModuleMock:
    
    95
    -    def __init__(self, name: str) -> None:
    
    96
    -        self._name = name
    
    97
    -
    
    98
    -        # HTTPUpload, ..
    
    99
    -        self.available = False
    
    100
    -
    
    101
    -        # Blocking
    
    102
    -        self.blocked = []  # type: List[Any]
    
    103
    -
    
    104
    -        # Delimiter
    
    105
    -        self.delimiter = '::'
    
    106
    -
    
    107
    -        # Bookmarks
    
    108
    -        self.bookmarks = {}  # type: Dict[Any, Any]
    
    109
    -
    
    110
    -        # Various Modules
    
    111
    -        self.supported = False
    
    112
    -
    
    113
    -    def __getattr__(self, key: str) -> MagicMock:
    
    114
    -        return MagicMock()
    
    115
    -
    
    116 93
     
    
    117 94
     def register_modules(con: ConnectionT, *args: Any, **kwargs: Any) -> None:
    
    118 95
         if con in _modules:
    
    ... ... @@ -153,10 +130,7 @@ def send_stored_publish(account: str) -> None:
    153 130
     
    
    154 131
     
    
    155 132
     def get(account: str, name: str) -> Any:
    
    156
    -    try:
    
    157
    -        return _modules[account][name]
    
    158
    -    except KeyError:
    
    159
    -        return ModuleMock(name)
    
    133
    +    return _modules[account][name]
    
    160 134
     
    
    161 135
     
    
    162 136
     def _load_module(name: str, con: ConnectionT, *args: Any, **kwargs: Any) -> Any: