@@ -699,19 +699,19 @@ def setUp(self):
699
699
self .admin_token_auth = f"Token { self .admin_token_only_user .auth_token .key } "
700
700
701
701
def test_schedule_list_anon_user_permitted (self ):
702
- response = self .client .get ("/api/v2/schedule /" )
702
+ response = self .client .get ("/api/v2/pipelines /" )
703
703
self .assertEqual (response .status_code , status .HTTP_200_OK )
704
704
705
705
def test_schedule_retrieve_anon_user_permitted (self ):
706
- response = self .client .get ("/api/v2/schedule /test_pipeline/" )
706
+ response = self .client .get ("/api/v2/pipelines /test_pipeline/" )
707
707
self .assertEqual (response .status_code , status .HTTP_200_OK )
708
708
709
709
@patch ("vulnerabilities.models.PipelineSchedule.create_new_job" )
710
710
def test_create_schedule_anon_user_not_permitted (self , mock_create_new_job ):
711
711
mock_create_new_job .return_value = "work-id2"
712
712
713
713
data = {"pipeline_id" : "test_pipeline2" }
714
- response = self .client .post ("/api/v2/schedule /" , data , format = "json" )
714
+ response = self .client .post ("/api/v2/pipelines /" , data , format = "json" )
715
715
716
716
self .assertNotEqual (response .status_code , status .HTTP_201_CREATED )
717
717
self .assertEqual (response .status_code , status .HTTP_403_FORBIDDEN )
@@ -725,7 +725,7 @@ def test_create_schedule_with_staff_token_not_permitted(self, mock_create_new_jo
725
725
mock_create_new_job .return_value = "work-id3"
726
726
727
727
data = {"pipeline_id" : "test_pipeline3" }
728
- response = self .client .post ("/api/v2/schedule /" , data , format = "json" )
728
+ response = self .client .post ("/api/v2/pipelines /" , data , format = "json" )
729
729
730
730
self .assertEqual (response .status_code , status .HTTP_403_FORBIDDEN )
731
731
self .assertNotEqual (response .status_code , status .HTTP_201_CREATED )
@@ -737,7 +737,7 @@ def test_create_schedule_with_staff_session_permitted(self, mock_create_new_job)
737
737
self .client .login (username = "admin_with_session" , password = "adminpassword" )
738
738
739
739
data = {"pipeline_id" : "test_pipeline3" }
740
- response = self .client .post ("/api/v2/schedule /" , data , format = "json" )
740
+ response = self .client .post ("/api/v2/pipelines /" , data , format = "json" )
741
741
742
742
self .assertNotEqual (response .status_code , status .HTTP_403_FORBIDDEN )
743
743
self .assertEqual (response .status_code , status .HTTP_201_CREATED )
@@ -748,7 +748,7 @@ def test_schedule_update_anon_user_not_permitted(self, mock_create_new_job):
748
748
mock_create_new_job .return_value = "work-id5"
749
749
750
750
data = {"run_interval" : 2 }
751
- response = self .client .patch ("/api/v2/schedule /test_pipeline/" , data , format = "json" )
751
+ response = self .client .patch ("/api/v2/pipelines /test_pipeline/" , data , format = "json" )
752
752
self .schedule1 .refresh_from_db ()
753
753
754
754
self .assertNotEqual (response .status_code , status .HTTP_200_OK )
@@ -763,7 +763,7 @@ def test_schedule_update_with_staff_token_not_permitted(self, mock_create_new_jo
763
763
mock_create_new_job .return_value = "work-id6"
764
764
765
765
data = {"run_interval" : 2 }
766
- response = self .client .patch ("/api/v2/schedule /test_pipeline/" , data , format = "json" )
766
+ response = self .client .patch ("/api/v2/pipelines /test_pipeline/" , data , format = "json" )
767
767
self .schedule1 .refresh_from_db ()
768
768
769
769
self .assertNotEqual (response .status_code , status .HTTP_200_OK )
@@ -776,7 +776,7 @@ def test_schedule_update_with_staff_session_permitted(self, mock_create_new_job)
776
776
self .client .login (username = "admin_with_session" , password = "adminpassword" )
777
777
778
778
data = {"run_interval" : 2 }
779
- response = self .client .patch ("/api/v2/schedule /test_pipeline/" , data , format = "json" )
779
+ response = self .client .patch ("/api/v2/pipelines /test_pipeline/" , data , format = "json" )
780
780
self .schedule1 .refresh_from_db ()
781
781
782
782
self .assertEqual (response .status_code , status .HTTP_200_OK )
0 commit comments