Refactor to C4kBuild

This commit is contained in:
erik 2023-04-28 13:28:40 +02:00
parent a28a1b43d3
commit 349884cb6c
3 changed files with 5 additions and 7 deletions

View file

@ -9,7 +9,7 @@ from .provs_k3s_mixin import ProvsK3sMixin, add_provs_k3s_mixin_config
from .aws_rds_pg_mixin import AwsRdsPgMixin, add_aws_rds_pg_mixin_config
from .aws_mfa_mixin import AwsMfaMixin, add_aws_mfa_mixin_config
from .aws_backend_properties_mixin import AwsBackendPropertiesMixin, add_aws_backend_properties_mixin_config
from .c4k_mixin import C4kMixin, add_c4k_mixin_config
from .c4k_mixin import C4kBuild, add_c4k_mixin_config
from .exoscale_mixin import ExoscaleMixin, add_exoscale_mixin_config
from .digitalocean_backend_properties_mixin import DigitaloceanBackendPropertiesMixin, add_digitalocean_backend_properties_mixin_config
from .digitalocean_terraform_build import DigitaloceanTerraformBuild, create_digitalocean_terraform_build_config

View file

@ -44,9 +44,7 @@ def add_c4k_mixin_config(
)
return config
#TODO: refactor this to C4kBuild
class C4kMixin(DevopsBuild):
class C4kBuild(DevopsBuild):
def __init__(self, project, config):
super().__init__(project, config)
self.execution_api = ExecutionApi()

View file

@ -1,9 +1,9 @@
import os
from pybuilder.core import Project
from src.main.python.ddadevops.domain import DnsRecord
from src.main.python.ddadevops.c4k_mixin import C4kMixin, add_c4k_mixin_config
from src.main.python.ddadevops.c4k_mixin import C4kBuild, add_c4k_mixin_config
class MyC4kMixin(C4kMixin):
class MyC4kBuild(C4kBuild):
pass
def test_c4k_mixin(tmp_path):
@ -29,7 +29,7 @@ def test_c4k_mixin(tmp_path):
assert project_config.get('C4kMixin') is not None
mixin = MyC4kMixin(project, project_config)
mixin = MyC4kBuild(project, project_config)
mixin.initialize_build_dir()
assert mixin.build_path() == f'{tmp_path_str}/{build_dir}/{project_name}/{module_name}'