Skip to content

Commit a308256

Browse files
author
Nikita Manovich
committed
Added a test case to cover issue #712.
1 parent 7284ba8 commit a308256

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

cvat/apps/engine/tests/test_rest_api.py

+23
Original file line numberDiff line numberDiff line change
@@ -1653,6 +1653,29 @@ def test_api_v1_jobs_id_annotations_user(self):
16531653
self._run_api_v1_jobs_id_annotations(self.user, self.assignee,
16541654
self.assignee)
16551655

1656+
def test_api_v1_jobs_id_annotations_observer(self):
1657+
task, jobs = self._create_task(self.user, self.assignee)
1658+
job = jobs[0]
1659+
data = {
1660+
"version": 0,
1661+
"tags": [],
1662+
"shapes": [],
1663+
"tracks": []
1664+
}
1665+
1666+
response = self._get_api_v1_jobs_id_data(job["id"], self.observer)
1667+
self.assertEqual(response.status_code, status.HTTP_200_OK)
1668+
1669+
response = self._put_api_v1_jobs_id_data(job["id"], self.observer, data)
1670+
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
1671+
1672+
response = self._patch_api_v1_jobs_id_data(job["id"], self.observer, "create", data)
1673+
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
1674+
1675+
response = self._delete_api_v1_jobs_id_data(job["id"], self.observer)
1676+
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
1677+
1678+
16561679
def test_api_v1_jobs_id_annotations_no_auth(self):
16571680
self._run_api_v1_jobs_id_annotations(self.user, self.assignee, None)
16581681

0 commit comments

Comments
 (0)