Skip to content

Commit

Permalink
REST API tests: patch tasks, post/patch issues (cvat-ai#4465)
Browse files Browse the repository at this point in the history
Co-authored-by: Kirill Sizov <[email protected]>
  • Loading branch information
ActiveChooN and Kirill Sizov authored Mar 18, 2022
1 parent d42e37c commit dd60b2d
Show file tree
Hide file tree
Showing 11 changed files with 970 additions and 30 deletions.
14 changes: 8 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@
}
],
"npm.exclude": "**/.env/**",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pycodestyleEnabled": false,
"licenser.license": "Custom",
"licenser.customHeader": "Copyright (C) @YEAR@ Intel Corporation\n\nSPDX-License-Identifier: MIT",
"files.trimTrailingWhitespace": true,
"python.pythonPath": ".env/bin/python",
"sqltools.connections": [
{
"previewLimit": 50,
Expand All @@ -33,9 +29,15 @@
"database": "${workspaceFolder:cvat}/db.sqlite3"
}
],
"python.defaultInterpreterPath": "${workspaceFolder}/.env/",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pycodestyleEnabled": false,
"python.testing.pytestArgs": [
"tests"
"--rootdir","${workspaceFolder}/tests/"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"python.testing.pytestPath": "${workspaceFolder}/.env/bin/pytest",
"python.testing.cwd": "${workspaceFolder}/tests"
}
2 changes: 1 addition & 1 deletion tests/rest_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ python utils/dump_objects.py
To restore DB and data volume, please use commands below.

```console
cat assets/cvat_db/data.json | docker exec -i cvat python manage.py --format=json loaddata -
cat assets/cvat_db/data.json | docker exec -i cvat python manage.py loaddata --format=json -
cat assets/cvat_db/cvat_data.tar.bz2 | docker exec -i cvat tar --strip 3 -C /home/django/data/ -xj
```

Expand Down
288 changes: 288 additions & 0 deletions tests/rest_api/assets/annotations.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,5 +298,293 @@
"tracks": [],
"version": 0
}
},
"task": {
"2": {
"shapes": [
{
"attributes": [],
"frame": 0,
"group": 0,
"id": 1,
"label_id": 3,
"occluded": false,
"points": [
223.39453125,
226.0751953125,
513.7663269042969,
377.9619903564453
],
"rotation": 0.0,
"source": "manual",
"type": "rectangle",
"z_order": 0
},
{
"attributes": [],
"frame": 1,
"group": 0,
"id": 2,
"label_id": 3,
"occluded": false,
"points": [
63.0791015625,
139.75390625,
132.19337349397574,
112.3867469879533,
189.71144578313397,
159.23614457831354,
191.1030120481937,
246.9048192771097,
86.73554216867524,
335.5012048192784,
32.00060240964012,
250.15180722891637
],
"rotation": 0.0,
"source": "manual",
"type": "polygon",
"z_order": 0
},
{
"attributes": [],
"frame": 1,
"group": 0,
"id": 3,
"label_id": 4,
"occluded": false,
"points": [
83.0244140625,
216.75390625,
112.24759036144678,
162.48313253012202,
167.44638554216908,
183.35662650602535,
149.35602409638705,
252.0072289156633,
84.41626506024113,
292.8265060240974,
72.81987951807241,
258.9650602409638
],
"rotation": 0.0,
"source": "manual",
"type": "polygon",
"z_order": 0
},
{
"attributes": [],
"frame": 2,
"group": 0,
"id": 4,
"label_id": 3,
"occluded": false,
"points": [
24.443359375,
107.2275390625,
84.91109877913368,
61.125083240844106,
169.4316315205324,
75.1561598224198,
226.5581576026634,
113.90865704772477,
240.5892341842391,
205.77880133185317,
210.52264150943483,
270.9230854605994
],
"rotation": 0.0,
"source": "manual",
"type": "polyline",
"z_order": 0
},
{
"attributes": [],
"frame": 22,
"group": 0,
"id": 5,
"label_id": 3,
"occluded": false,
"points": [
148.94921875,
285.6865234375,
313.515094339622,
400.32830188679145,
217.36415094339463,
585.2339622641503,
64.81698113207494,
499.25283018867776
],
"rotation": 0.0,
"source": "manual",
"type": "points",
"z_order": 0
}
],
"tags": [],
"tracks": [],
"version": 0
},
"5": {
"shapes": [
{
"attributes": [],
"frame": 0,
"group": 0,
"id": 29,
"label_id": 9,
"occluded": false,
"points": [
364.0361328125,
528.87890625,
609.5286041189956,
586.544622425632,
835.2494279176244,
360.0000000000018,
543.6247139588122,
175.4691075514893,
326.9656750572103,
192.76887871853796,
244.58581235698148,
319.63386727689067
],
"rotation": 0.0,
"source": "manual",
"type": "polygon",
"z_order": 0
}
],
"tags": [],
"tracks": [],
"version": 0
},
"6": {
"shapes": [],
"tags": [],
"tracks": [],
"version": 0
},
"7": {
"shapes": [
{
"attributes": [],
"frame": 0,
"group": 0,
"id": 27,
"label_id": 11,
"occluded": false,
"points": [
448.3779296875,
356.4892578125,
438.2558352402775,
761.3861556064112,
744.1780320366161,
319.37356979405195,
446.1288329519466,
163.03832951945333
],
"rotation": 0.0,
"source": "manual",
"type": "polygon",
"z_order": 0
}
],
"tags": [],
"tracks": [],
"version": 0
},
"8": {
"shapes": [
{
"attributes": [],
"frame": 0,
"group": 0,
"id": 30,
"label_id": 13,
"occluded": false,
"points": [
440.0439453125,
84.0791015625,
71.83311938382576,
249.81514762516053,
380.4441591784325,
526.585365853658,
677.6251604621302,
260.42875481386363,
629.4557124518615,
127.35044929396645
],
"rotation": 0.0,
"source": "manual",
"type": "polygon",
"z_order": 0
}
],
"tags": [],
"tracks": [],
"version": 0
},
"9": {
"shapes": [
{
"attributes": [],
"frame": 0,
"group": 0,
"id": 31,
"label_id": 6,
"occluded": false,
"points": [
65.6189987163034,
100.96585365853753,
142.12734274711147,
362.6243902439037
],
"rotation": 0.0,
"source": "manual",
"type": "rectangle",
"z_order": 0
}
],
"tags": [],
"tracks": [],
"version": 0
},
"11": {
"shapes": [
{
"attributes": [],
"frame": 0,
"group": 0,
"id": 33,
"label_id": 7,
"occluded": false,
"points": [
100.14453125,
246.03515625,
408.8692551505537,
327.5483359746413,
588.5839936608554,
289.0380348652925,
623.8851030110927,
183.77654516640177,
329.2812995245622,
71.45483359746322
],
"rotation": 0.0,
"source": "manual",
"type": "polyline",
"z_order": 0
}
],
"tags": [],
"tracks": [],
"version": 0
},
"12": {
"shapes": [],
"tags": [],
"tracks": [],
"version": 0
}
}
}
Loading

0 comments on commit dd60b2d

Please sign in to comment.