Skip to content

Commit

Permalink
Update tests for render_target()
Browse files Browse the repository at this point in the history
  • Loading branch information
simu committed Oct 10, 2022
1 parent 4015b67 commit 75cdebe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pathlib import Path as P
from textwrap import dedent

from commodore import cluster
from commodore import cluster, __kustomize_wrapper__
from commodore.inventory import Inventory
from commodore.config import Config

Expand Down Expand Up @@ -58,14 +58,14 @@ def test_render_bootstrap_target(tmp_path: P):
"global.commodore",
]
assert target != ""
print(target)
assert len(target["classes"]) == len(
classes
), "rendered target includes different amount of classes"
for i in range(len(classes)):
assert target["classes"][i] == classes[i]
assert target["parameters"]["_instance"] == "cluster"
assert "_base_directory" not in target["parameters"]
assert "_kustomize_wrapper" not in target["parameters"]


def test_render_target(tmp_path: P):
Expand All @@ -89,7 +89,6 @@ def test_render_target(tmp_path: P):
"components.foo",
]
assert target != ""
print(target)
assert len(target["classes"]) == len(
classes
), "rendered target includes different amount of classes"
Expand All @@ -98,6 +97,7 @@ def test_render_target(tmp_path: P):
assert target["parameters"]["kapitan"]["vars"]["target"] == "foo"
assert target["parameters"]["_instance"] == "foo"
assert target["parameters"]["_base_directory"] == str(tmp_path / "foo")
assert target["parameters"]["_kustomize_wrapper"] == str(__kustomize_wrapper__)


def test_render_aliased_target(tmp_path: P):
Expand Down

0 comments on commit 75cdebe

Please sign in to comment.