Skip to content

Commit e452eff

Browse files
dimakisanishasthana
authored andcommitted
test: add test which raises error when no image is supplied
1 parent 3b90334 commit e452eff

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: tests/unit_test.py

+12
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,18 @@ def test_cluster_creation(mocker):
263263
"unit-test-cluster.yaml", f"{parent}/tests/test-case.yaml", shallow=True
264264
)
265265

266+
def test_create_app_wrapper_raises_error_with_no_image():
267+
config = createClusterConfig()
268+
config.image = "" # Clear the image to test error handling
269+
try:
270+
cluster = Cluster(config)
271+
cluster.create_app_wrapper()
272+
assert False, "Expected ValueError when 'image' is not specified."
273+
except ValueError as error:
274+
assert str(error) == "Image must be specified in the ClusterConfiguration", \
275+
"Error message did not match expected output."
276+
277+
266278
def test_cluster_creation_no_mcad(mocker):
267279
mocker.patch(
268280
"kubernetes.client.CustomObjectsApi.get_cluster_custom_object",

0 commit comments

Comments
 (0)