forked from HumanSignal/label-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate annotators emails when import previous exports (HumanSignal#…
…1184) * Validate annotators emails when import previous exports * Fix default completed_by, add test samples * Remove unused code * Address comments Co-authored-by: nik <[email protected]>
- Loading branch information
Showing
4 changed files
with
165 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -350,3 +350,71 @@ stages: | |
deleted: 2 | ||
status_code: 200 | ||
|
||
--- | ||
test_name: import_previous_export | ||
strict: false | ||
marks: | ||
- usefixtures: | ||
- django_live_url | ||
stages: | ||
- id: signup | ||
type: ref | ||
- name: stage | ||
request: | ||
data: | ||
label_config: <View><Image name="image" value="$image"/><Choices name="label" toName="image"><Choice | ||
value="Cat"/><Choice value="Dog"/></Choices></View> | ||
title: Image Classification Project | ||
method: POST | ||
url: '{django_live_url}/api/projects' | ||
response: | ||
save: | ||
json: | ||
project_pk: id | ||
status_code: 201 | ||
- name: stage | ||
request: | ||
files: | ||
json: tests/test_suites/samples/previous_export.json | ||
headers: | ||
content-type: multipart/form-data | ||
method: POST | ||
url: '{django_live_url}/api/projects/{project_pk}/import' | ||
response: | ||
status_code: 400 | ||
json: | ||
validation_errors: | ||
non_field_errors: | ||
- "Unknown annotator's email [email protected]" | ||
# Now let's create missed user and try again... | ||
- id: logout | ||
type: ref | ||
- id: signup | ||
name: Sign up | ||
request: | ||
url: "{django_live_url}/user/signup" | ||
data: | ||
email: [email protected] | ||
password: 12345678 | ||
method: POST | ||
response: | ||
status_code: 302 | ||
- id: login | ||
type: ref | ||
- name: stage | ||
request: | ||
files: | ||
json: tests/test_suites/samples/previous_export.json | ||
headers: | ||
content-type: multipart/form-data | ||
method: POST | ||
url: '{django_live_url}/api/projects/{project_pk}/import' | ||
response: | ||
status_code: 201 | ||
json: | ||
task_count: 1 | ||
annotation_count: 1 | ||
prediction_count: 0 | ||
could_be_tasks_list: false | ||
found_formats: {'.json': 1} | ||
data_columns: ['image'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,23 @@ stages: | |
method: POST | ||
response: | ||
status_code: 302 | ||
- id: login | ||
name: Login | ||
request: | ||
url: "{django_live_url}/user/login" | ||
data: | ||
email: [email protected] | ||
password: 12345678 | ||
method: POST | ||
response: | ||
status_code: 302 | ||
- id: logout | ||
name: logout | ||
request: | ||
url: "{django_live_url}/logout" | ||
method: GET | ||
response: | ||
status_code: 302 | ||
- id: create_project | ||
name: create_project | ||
request: | ||
|
43 changes: 43 additions & 0 deletions
43
label_studio/tests/test_suites/samples/previous_export.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"id": 1234, | ||
"annotations": [ | ||
{ | ||
"id": 5678, | ||
"completed_by": { | ||
"id": 42, | ||
"email": "[email protected]", | ||
"first_name": "", | ||
"last_name": "" | ||
}, | ||
"result": [ | ||
{ | ||
"id": "aBcDeF", | ||
"type": "choices", | ||
"value": { | ||
"choices": [ | ||
"Cat" | ||
] | ||
}, | ||
"to_name": "image", | ||
"from_name": "label" | ||
} | ||
], | ||
"was_cancelled": false, | ||
"ground_truth": false, | ||
"created_at": "2021-07-06T06:06:25.927570Z", | ||
"updated_at": "2021-07-06T06:44:08.446371Z", | ||
"lead_time": 346193.271, | ||
"prediction": {}, | ||
"result_count": 0, | ||
"task": 1234 | ||
} | ||
], | ||
"predictions": [], | ||
"data": { | ||
"image": "https://pytest.labelstud.io/mypets.jpg" | ||
}, | ||
"meta": {}, | ||
"created_at": "2021-05-28T18:56:52.086267Z", | ||
"updated_at": "2021-07-06T06:44:08.420891Z", | ||
"project": 49 | ||
} |