@@ -91,73 +91,39 @@ def test_success(self, mock_post):
9191 from roboflow .adapters .rfapi import create_annotation_job
9292
9393 mock_post .return_value = MagicMock (status_code = 201 , json = lambda : {"job" : {"id" : "j2" }})
94- result = create_annotation_job (
95- "key" ,
96- "ws" ,
97- "proj" ,
98- name = "my-job" ,
99- batch_id = "b1" ,
100- labeler_email = "labeler@example.com" ,
101- reviewer_email = "reviewer@example.com" ,
102- )
94+ result = create_annotation_job ("key" , "ws" , "proj" , name = "my-job" , batch_id = "b1" )
10395 self .assertEqual (result ["job" ]["id" ], "j2" )
10496 # Verify URL and payload
10597 call_args = mock_post .call_args
10698 self .assertIn ("/ws/proj/jobs" , call_args [0 ][0 ])
10799 payload = call_args [1 ]["json" ]
108100 self .assertEqual (payload ["name" ], "my-job" )
109- self .assertEqual (payload ["batch" ], "b1" )
110- self .assertEqual (payload ["labelerEmail" ], "labeler@example.com" )
111- self .assertEqual (payload ["reviewerEmail" ], "reviewer@example.com" )
101+ self .assertEqual (payload ["batchId" ], "b1" )
112102
113103 @patch ("roboflow.adapters.rfapi.requests.post" )
114104 def test_success_200 (self , mock_post ):
115105 from roboflow .adapters .rfapi import create_annotation_job
116106
117107 mock_post .return_value = MagicMock (status_code = 200 , json = lambda : {"job" : {"id" : "j3" }})
118- result = create_annotation_job (
119- "key" ,
120- "ws" ,
121- "proj" ,
122- batch_id = "b1" ,
123- labeler_email = "labeler@example.com" ,
124- reviewer_email = "reviewer@example.com" ,
125- )
108+ result = create_annotation_job ("key" , "ws" , "proj" , name = "my-job" )
126109 self .assertEqual (result ["job" ]["id" ], "j3" )
127110
128111 @patch ("roboflow.adapters.rfapi.requests.post" )
129- def test_with_optional_fields (self , mock_post ):
112+ def test_with_assignees (self , mock_post ):
130113 from roboflow .adapters .rfapi import create_annotation_job
131114
132115 mock_post .return_value = MagicMock (status_code = 201 , json = lambda : {"job" : {"id" : "j4" }})
133- create_annotation_job (
134- "key" ,
135- "ws" ,
136- "proj" ,
137- batch_id = "b1" ,
138- labeler_email = "labeler@example.com" ,
139- reviewer_email = "reviewer@example.com" ,
140- num_images = 10 ,
141- instructions = "Use the guide" ,
142- )
116+ create_annotation_job ("key" , "ws" , "proj" , name = "j" , assignees = ["a@b.com" ])
143117 payload = mock_post .call_args [1 ]["json" ]
144- self .assertEqual (payload ["num_images" ], 10 )
145- self .assertEqual (payload ["instructionText" ], "Use the guide" )
118+ self .assertEqual (payload ["assignees" ], ["a@b.com" ])
146119
147120 @patch ("roboflow.adapters.rfapi.requests.post" )
148121 def test_error (self , mock_post ):
149122 from roboflow .adapters .rfapi import RoboflowError , create_annotation_job
150123
151124 mock_post .return_value = MagicMock (status_code = 400 , text = "Bad request" )
152125 with self .assertRaises (RoboflowError ):
153- create_annotation_job (
154- "key" ,
155- "ws" ,
156- "proj" ,
157- batch_id = "b1" ,
158- labeler_email = "labeler@example.com" ,
159- reviewer_email = "reviewer@example.com" ,
160- )
126+ create_annotation_job ("key" , "ws" , "proj" , name = "j" )
161127
162128
163129class TestListFolders (unittest .TestCase ):
0 commit comments