From 8a4be5491a7448c18635ae90078b9da19c67d4d0 Mon Sep 17 00:00:00 2001 From: Adam Souzis Date: Thu, 3 Oct 2024 05:07:25 -0700 Subject: [PATCH] fix tests --- tests/examples/decorators-ensemble.yaml | 2 +- tests/examples/test-workflow-ensemble.yaml | 2 +- tests/test_cli.py | 2 +- unfurl/init.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/examples/decorators-ensemble.yaml b/tests/examples/decorators-ensemble.yaml index e4e61c0e..956ee1dc 100644 --- a/tests/examples/decorators-ensemble.yaml +++ b/tests/examples/decorators-ensemble.yaml @@ -3,7 +3,7 @@ kind: Ensemble spec: service_template: imports: - - file: spec/decorators-import-template.yaml + - file: import/spec/decorators-import-template.yaml decorators: missing: diff --git a/tests/examples/test-workflow-ensemble.yaml b/tests/examples/test-workflow-ensemble.yaml index a98f24a4..d67d2ca8 100644 --- a/tests/examples/test-workflow-ensemble.yaml +++ b/tests/examples/test-workflow-ensemble.yaml @@ -3,7 +3,7 @@ kind: Ensemble spec: service_template: imports: - - file: spec/service_template.yaml + - file: import/spec/service_template.yaml - repository: unfurl file: tosca_plugins/k8s.yaml diff --git a/tests/test_cli.py b/tests/test_cli.py index dd931fa0..ed4a5d95 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -407,7 +407,7 @@ def test_clone_project(self): runner = CliRunner() with runner.isolated_filesystem(): specTemplate = os.path.join( - os.path.dirname(__file__), "examples/spec/service_template.yaml" + os.path.dirname(__file__), "examples/import/spec/service_template.yaml" ) result = runner.invoke( cli, diff --git a/unfurl/init.py b/unfurl/init.py index f539e3e9..ff148d4b 100644 --- a/unfurl/init.py +++ b/unfurl/init.py @@ -798,7 +798,7 @@ def configure(self, remote_source: bool): f"creating ensemble from {'remote' if remote_source else 'local'} {'' if source_has_ensembles else 'blueprint '}repo at {source_path} with %s", self.template_vars, ) - assert self.template_vars + assert self.template_vars is not None if self.options.get("use_deployment_blueprint"): self.template_vars["deployment_blueprint"] = self.options[ "use_deployment_blueprint" @@ -833,7 +833,7 @@ def _create_ensemble_from_template(self, project: Project, destDir, manifestName specProject = assert_not_none(self.dest_project) source_project = assert_not_none(self.source_project) - assert self.template_vars + assert self.template_vars is not None sourceDir = os.path.normpath( os.path.join(source_project.projectRoot, self.template_vars["sourceDir"]) ) @@ -1085,7 +1085,7 @@ def set_dest_project_and_path( def has_existing_ensemble(self, sourceProject: Optional[Project]) -> bool: if self.source_project is not sourceProject and not self.shared_repo: - assert self.template_vars + assert self.template_vars is not None if "localEnv" in self.template_vars and os.path.exists( Path(assert_not_none(self.dest_project).projectRoot) / assert_not_none(self.dest_path)