[Skip CI] Uncomment assertion in test_image_build

Add logging.
merge-requests/6/merge
erik 1 year ago
parent 580bf81c15
commit 381baa2eb2

@ -1,4 +1,5 @@
import deprecation
import logging
from typing import List
def filter_none(list_to_filter):
@ -35,11 +36,12 @@ class DnsRecord(Validateable):
class Devops(Validateable):
def __init__(
self, stage, project_root_path, module, name=None, build_dir_name="target"
self, stage: str, project_root_path: str, module: str, name: str | None =None, build_dir_name: str="target"
):
self.stage = stage
self.name = name
self.project_root_path = project_root_path
logging.warn(f"Set project root in DevOps {self.project_root_path}")
self.module = module
if not name:
self.name = module
@ -54,6 +56,7 @@ class Devops(Validateable):
def build_path(self):
path = [self.project_root_path, self.build_dir_name, self.name, self.module]
logging.warn(f"Set project build_path in Devops {path}")
return "/".join(filter_none(path))
def __put__(self, key, value):

@ -16,9 +16,10 @@ def test_devops_docker_build(tmp_path):
project_root_path=tmp_path_str,
module=module_name,
name=project_name,
build_dir_name=build_dir
)
image = Image(dockerhub_user="user", dockerhub_password="password", devops=devops)
docker_build = DevopsImageBuild(project, image=image)
# docker_build.initialize_build_dir()
# assert os.path.exists(f"{docker_build.build_path()}")
docker_build.initialize_build_dir()
assert os.path.exists(f"{docker_build.build_path()}")

Loading…
Cancel
Save