@@ -587,3 +587,47 @@ def test_update_and_delete_computation(
587
587
assert (
588
588
response .status_code == status .HTTP_204_NO_CONTENT
589
589
), f"response code is { response .status_code } , error: { response .text } "
590
+
591
+
592
+ def test_pipeline_with_no_comp_services_still_create_correct_comp_tasks (
593
+ client : TestClient ,
594
+ user_id : PositiveInt ,
595
+ project : Callable ,
596
+ jupyter_service : Dict [str , str ],
597
+ ):
598
+ # create a workbench with just a dynamic service
599
+ project_with_dynamic_node = project (
600
+ workbench = {
601
+ "39e92f80-9286-5612-85d1-639fa47ec57d" : {
602
+ "key" : jupyter_service ["image" ]["name" ],
603
+ "version" : jupyter_service ["image" ]["tag" ],
604
+ "label" : "my sole dynamic service" ,
605
+ }
606
+ }
607
+ )
608
+
609
+ # this pipeline is not runnable as there are no computational services
610
+ response = client .post (
611
+ COMPUTATION_URL ,
612
+ json = {
613
+ "user_id" : user_id ,
614
+ "project_id" : str (project_with_dynamic_node .uuid ),
615
+ "start_pipeline" : True ,
616
+ },
617
+ )
618
+ assert (
619
+ response .status_code == status .HTTP_422_UNPROCESSABLE_ENTITY
620
+ ), f"response code is { response .status_code } , error: { response .text } "
621
+
622
+ # still this pipeline shall be createable if we do not want to start it
623
+ response = client .post (
624
+ COMPUTATION_URL ,
625
+ json = {
626
+ "user_id" : user_id ,
627
+ "project_id" : str (project_with_dynamic_node .uuid ),
628
+ "start_pipeline" : False ,
629
+ },
630
+ )
631
+ assert (
632
+ response .status_code == status .HTTP_201_CREATED
633
+ ), f"response code is { response .status_code } , error: { response .text } "
0 commit comments