Improved testing

This commit is contained in:
2020-11-29 17:29:16 +01:00
parent fea84418d3
commit 16516b7fe6
19 changed files with 173 additions and 27 deletions

View File

@@ -7,6 +7,7 @@ from sh_edraft.configuration.base.configuration_base import ConfigurationBase
from sh_edraft.configuration.model.configuration_variable_name import ConfigurationVariableName
from sh_edraft.environment.base.environment_base import EnvironmentBase
from sh_edraft.environment.hosting_environment import HostingEnvironment
from sh_edraft.environment.model import EnvironmentName
from sh_edraft.utils import Console
@@ -36,7 +37,7 @@ class Configuration(ConfigurationBase):
def _set_variable(self, name: str, value: str):
if name == ConfigurationVariableName.environment.value:
self._hosting_environment.environment_name = value
self._hosting_environment.environment_name = EnvironmentName(value)
elif name == ConfigurationVariableName.name.value:
self._hosting_environment.application_name = value

View File

@@ -1,7 +1,5 @@
from abc import ABC, abstractmethod
from sh_edraft.environment.model.environment_name import EnvironmentName
class EnvironmentBase(ABC):
@@ -10,11 +8,11 @@ class EnvironmentBase(ABC):
@property
@abstractmethod
def environment_name(self) -> EnvironmentName: pass
def environment_name(self) -> str: pass
@environment_name.setter
@abstractmethod
def environment_name(self, environment_name: EnvironmentName): pass
def environment_name(self, environment_name: str): pass
@property
@abstractmethod

View File

@@ -16,12 +16,12 @@ class HostingEnvironment(EnvironmentBase):
self._content_root_path: Optional[str] = crp
@property
def environment_name(self) -> EnvironmentName:
return self._environment_name
def environment_name(self) -> str:
return str(self._environment_name.value)
@environment_name.setter
def environment_name(self, environment_name: EnvironmentName):
self._environment_name = environment_name
def environment_name(self, environment_name: str):
self._environment_name = EnvironmentName(environment_name)
@property
def application_name(self) -> str:

View File

@@ -1,4 +1,3 @@
import sys
from datetime import datetime
from sh_edraft.configuration.configuration import Configuration

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
sh_edraft.service
sh_edraft.services
~~~~~~~~~~~~~~~~~~~
@@ -11,7 +11,7 @@ sh_edraft.service
"""
__title__ = 'sh_edraft.service'
__title__ = 'sh_edraft.services'
__author__ = 'Sven Heidemann'
__license__ = 'MIT'
__copyright__ = 'Copyright (c) 2020 sh-edraft.de'

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
sh_edraft.service.base
sh_edraft.services.base
~~~~~~~~~~~~~~~~~~~
@@ -11,7 +11,7 @@ sh_edraft.service.base
"""
__title__ = 'sh_edraft.service.base'
__title__ = 'sh_edraft.services.base'
__author__ = 'Sven Heidemann'
__license__ = 'MIT'
__copyright__ = 'Copyright (c) 2020 sh-edraft.de'

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
sh_edraft.service.base
sh_edraft.services.base
~~~~~~~~~~~~~~~~~~~
@@ -11,7 +11,7 @@ sh_edraft.service.base
"""
__title__ = 'sh_edraft.service.base'
__title__ = 'sh_edraft.services.base'
__author__ = 'Sven Heidemann'
__license__ = 'MIT'
__copyright__ = 'Copyright (c) 2020 sh-edraft.de'