Improved hosting

This commit is contained in:
2020-11-26 11:20:21 +01:00
parent 5faac76c32
commit ead0eae5f0
19 changed files with 124 additions and 37 deletions

View File

@@ -1,10 +1,10 @@
import os
import shutil
import unittest
from datetime import datetime
from string import Template
from sh_edraft.hosting import ApplicationHost
from sh_edraft.hosting import ApplicationHost, HostingEnvironment
from sh_edraft.hosting.model import EnvironmentName
from sh_edraft.logging import Logger
from sh_edraft.logging.model import LoggingSettings
from sh_edraft.time.model import TimeFormatSettings
@@ -13,7 +13,7 @@ from sh_edraft.time.model import TimeFormatSettings
class LoggerTest(unittest.TestCase):
def setUp(self):
self._app_host = ApplicationHost()
self._app_host = ApplicationHost('CPL_Test', HostingEnvironment(EnvironmentName.testing, './'))
self._services = self._app_host.services
self._services.create()

View File

@@ -2,14 +2,13 @@ import os
import shutil
import unittest
from sh_edraft.hosting import ApplicationHost
from sh_edraft.hosting import ApplicationHost, HostingEnvironment
from sh_edraft.hosting.model import EnvironmentName
from sh_edraft.logging import Logger
from sh_edraft.logging.base import LoggerBase
from sh_edraft.logging.model import LoggingSettings
from sh_edraft.publishing import Publisher
from sh_edraft.publishing.base import PublisherBase
from sh_edraft.publishing.model import Template
from sh_edraft.publishing.model.publish_settings_model import PublishSettingsModel
from sh_edraft.publishing.model import PublishSettingsModel
from sh_edraft.coding.model import Version
from sh_edraft.time.model import TimeFormatSettings
@@ -79,7 +78,7 @@ class PublisherTest(unittest.TestCase):
def setUp(self):
self._config()
self._app_host = ApplicationHost()
self._app_host = ApplicationHost('CPL_Test', HostingEnvironment(EnvironmentName.testing, './'))
self._logger = Logger(self._log_settings, self._time_format_settings, self._app_host)
self._logger.create()

View File

@@ -1,12 +1,14 @@
import unittest
from sh_edraft.hosting import ApplicationHost
from sh_edraft.hosting import HostingEnvironment
from sh_edraft.hosting.model import EnvironmentName
from sh_edraft.logging import Logger
from sh_edraft.logging.base import LoggerBase
from sh_edraft.logging.model import LoggingSettings
from sh_edraft.publishing import Publisher
from sh_edraft.publishing.base import PublisherBase
from sh_edraft.publishing.model.publish_settings_model import PublishSettingsModel
from sh_edraft.publishing.model import PublishSettingsModel
from sh_edraft.service import ServiceProvider
from sh_edraft.service.base import ServiceBase
from sh_edraft.time.model import TimeFormatSettings
@@ -15,7 +17,7 @@ from sh_edraft.time.model import TimeFormatSettings
class ServiceProviderTest(unittest.TestCase):
def setUp(self):
self._app_host = ApplicationHost()
self._app_host = ApplicationHost('CPL_Test', HostingEnvironment(EnvironmentName.testing, './'))
self._services = self._app_host.services
self._services.create()
@@ -59,7 +61,7 @@ class ServiceProviderTest(unittest.TestCase):
def test_create(self):
print(f'{__name__}.test_create:')
provider = ServiceProvider()
provider = ServiceProvider(self._app_host)
self.assertIsNotNone(provider)
provider.create()
self.assertIsNotNone(provider)