Philipp Hörist pushed to branch mainwindow at gajim / gajim
Commits: 135e8063 by lovetox at 2021-03-10T20:39:41+01:00 Remove module mock
- - - - -
1 changed file:
- gajim/common/modules/__init__.py
Changes:
===================================== gajim/common/modules/__init__.py ===================================== @@ -20,7 +20,6 @@ import sys import logging from importlib import import_module -from unittest.mock import MagicMock
from gajim.common.types import ConnectionT
@@ -91,28 +90,6 @@ ] # type: List[str]
-class ModuleMock: - def __init__(self, name: str) -> None: - self._name = name - - # HTTPUpload, .. - self.available = False - - # Blocking - self.blocked = [] # type: List[Any] - - # Delimiter - self.delimiter = '::' - - # Bookmarks - self.bookmarks = {} # type: Dict[Any, Any] - - # Various Modules - self.supported = False - - def __getattr__(self, key: str) -> MagicMock: - return MagicMock() -
def register_modules(con: ConnectionT, *args: Any, **kwargs: Any) -> None: if con in _modules: @@ -153,10 +130,7 @@ def send_stored_publish(account: str) -> None:
def get(account: str, name: str) -> Any: - try: - return _modules[account][name] - except KeyError: - return ModuleMock(name) + return _modules[account][name]
def _load_module(name: str, con: ConnectionT, *args: Any, **kwargs: Any) -> Any:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/135e80639665628f44066632bb1a057a7...