Skip to content

Commit

Permalink
test: add test which raises error when no image is supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
dimakis committed Nov 9, 2023
1 parent 07bfa3d commit 3a01897
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,18 @@ def test_cluster_creation(mocker):
"unit-test-cluster.yaml", f"{parent}/tests/test-case.yaml", shallow=True
)

def test_create_app_wrapper_raises_error_with_no_image():
config = createClusterConfig()
config.image = "" # Clear the image to test error handling
try:
cluster = Cluster(config)
cluster.create_app_wrapper()
assert False, "Expected ValueError when 'image' is not specified."
except ValueError as error:
assert str(error) == "Image must be specified in the ClusterConfiguration", \
"Error message did not match expected output."


def test_cluster_creation_no_mcad(mocker):
mocker.patch(
"kubernetes.client.CustomObjectsApi.get_cluster_custom_object",
Expand Down

0 comments on commit 3a01897

Please sign in to comment.