Added testing for service provider with unittests. Also fixed small bugs, found while testing.

This commit is contained in:
2020-11-23 22:22:17 +01:00
parent dd65bbb182
commit c7dff4a212
10 changed files with 178 additions and 100 deletions

View File

@@ -1,6 +1,10 @@
from abc import abstractmethod
from typing import Optional
from sh_edraft.service.base import ServiceBase
from sh_edraft.configuration.application_host import ApplicationHost
from sh_edraft.logging.model.log_settings import LoggingSettings
from sh_edraft.service.base.service_base import ServiceBase
from sh_edraft.time.model.time_format_settings import TimeFormatSettings
class LoggerBase(ServiceBase):
@@ -9,6 +13,10 @@ class LoggerBase(ServiceBase):
def __init__(self):
ServiceBase.__init__(self)
self._log_settings: Optional[LoggingSettings] = None
self._time_format_settings: Optional[TimeFormatSettings] = None
self._app_host: Optional[ApplicationHost] = None
@abstractmethod
def header(self, string: str): pass

View File

@@ -4,11 +4,8 @@ import traceback
from string import Template
from typing import Optional
from sh_edraft.configuration.application_host import ApplicationHost
from sh_edraft.logging.base.logger_base import LoggerBase
from sh_edraft.logging.model.log_level import LoggingLevel
from sh_edraft.logging.model.log_settings import LoggingSettings
from sh_edraft.time.model.time_format_settings import TimeFormatSettings
from sh_edraft.utils.console import Console
@@ -17,10 +14,6 @@ class Logger(LoggerBase):
def __init__(self):
LoggerBase.__init__(self)
self._log_settings: Optional[LoggingSettings] = None
self._time_format_settings: Optional[TimeFormatSettings] = None
self._app_host: Optional[ApplicationHost] = None
self._log: Optional[str] = None
self._path: Optional[str] = None
self._level: Optional[LoggingLevel] = None