Improved tests
This commit is contained in:
parent
ead0eae5f0
commit
c815e75282
@ -14,8 +14,6 @@ class LoggerTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self._app_host = ApplicationHost('CPL_Test', HostingEnvironment(EnvironmentName.testing, './'))
|
||||
self._services = self._app_host.services
|
||||
self._services.create()
|
||||
|
||||
self._log_settings = LoggingSettings()
|
||||
self._log_settings.from_dict({
|
||||
@ -38,7 +36,6 @@ class LoggerTest(unittest.TestCase):
|
||||
shutil.rmtree(self._log_settings.path)
|
||||
|
||||
def _check_general_requirements(self):
|
||||
self.assertIsNotNone(self._services)
|
||||
self.assertIsNotNone(self._log_settings)
|
||||
self.assertIsNotNone(self._time_format_settings)
|
||||
|
||||
|
@ -1,59 +0,0 @@
|
||||
import os
|
||||
|
||||
from sh_edraft.logging.base.logger_base import LoggerBase
|
||||
from sh_edraft.publishing.base import PublisherBase
|
||||
from sh_edraft.service.base import ServiceProviderBase
|
||||
from sh_edraft.coding.model import Version
|
||||
from sh_edraft.publishing import Publisher
|
||||
from sh_edraft.publishing.model import Template
|
||||
|
||||
|
||||
class PublisherTest:
|
||||
|
||||
@staticmethod
|
||||
def start(services: ServiceProviderBase):
|
||||
version = Version(2020, 12, 5).to_dict()
|
||||
templates = [
|
||||
Template(
|
||||
'../../publish_templates/*_template.txt',
|
||||
'*',
|
||||
'',
|
||||
'',
|
||||
'2020',
|
||||
'sh-edraft.de',
|
||||
'MIT',
|
||||
', see LICENSE for more details.',
|
||||
'',
|
||||
'Sven Heidemann',
|
||||
version
|
||||
),
|
||||
Template(
|
||||
'../../publish_templates/*_template.txt',
|
||||
'sh_edraft',
|
||||
'common python library',
|
||||
'Library to share common classes and models used at sh-edraft.de',
|
||||
'2020',
|
||||
'sh-edraft.de',
|
||||
'MIT',
|
||||
', see LICENSE for more details.',
|
||||
'',
|
||||
'Sven Heidemann',
|
||||
version
|
||||
)
|
||||
]
|
||||
|
||||
source = '../'
|
||||
dist = '../../dist'
|
||||
|
||||
services.add_transient(Publisher, services.get_service(LoggerBase), source, dist, templates)
|
||||
publisher: Publisher = services.get_service(PublisherBase)
|
||||
|
||||
publisher.exclude('../tests/')
|
||||
publisher.include('../../LICENSE')
|
||||
publisher.include('../../README.md')
|
||||
|
||||
publisher.create()
|
||||
publisher.publish()
|
||||
|
||||
if not os.path.isdir(dist):
|
||||
raise Exception(f'{__name__}: Dist path was not created')
|
Loading…
Reference in New Issue
Block a user