10
10
"""
11
11
12
12
13
- def test_create_from_url (client , model_run_with_model_run_data_rows ,
13
+ def test_create_from_url (model_run_with_model_run_data_rows ,
14
14
annotation_import_test_helpers ):
15
15
name = str (uuid .uuid4 ())
16
16
url = "https://storage.googleapis.com/labelbox-public-bucket/predictions_test_v2.ndjson"
@@ -19,20 +19,10 @@ def test_create_from_url(client, model_run_with_model_run_data_rows,
19
19
assert annotation_import .model_run_id == model_run_with_model_run_data_rows .uid
20
20
annotation_import_test_helpers .check_running_state (annotation_import , name ,
21
21
url )
22
- import_id = client .execute (
23
- """query get_mea_importPyApi($model_run_id: ID!) {
24
- modelErrorAnalysisPredictionImports(where: {modelRunId: $model_run_id}) {
25
- id
26
- }}""" , {"model_run_id" : annotation_import .parent_id
27
- })['modelErrorAnalysisPredictionImports' ][0 ]['id' ]
28
- client .execute (
29
- """mutation deleteModelErrorAnalysisPredictionImportPyApi($import_id: ID!) {
30
- deleteModelErrorAnalysisPredictionImport(where: {id: $import_id}) {
31
- id
32
- }}""" , {"import_id" : import_id })
33
-
34
-
35
- def test_create_from_objects (client , model_run_with_model_run_data_rows ,
22
+ annotation_import .wait_until_done ()
23
+
24
+
25
+ def test_create_from_objects (model_run_with_model_run_data_rows ,
36
26
object_predictions ,
37
27
annotation_import_test_helpers ):
38
28
name = str (uuid .uuid4 ())
@@ -44,21 +34,10 @@ def test_create_from_objects(client, model_run_with_model_run_data_rows,
44
34
annotation_import_test_helpers .check_running_state (annotation_import , name )
45
35
annotation_import_test_helpers .assert_file_content (
46
36
annotation_import .input_file_url , object_predictions )
47
- import_id = client .execute (
48
- """query get_mea_importPyApi($model_run_id: ID!) {
49
- modelErrorAnalysisPredictionImports(where: {modelRunId: $model_run_id}) {
50
- id
51
- }}""" , {"model_run_id" : annotation_import .parent_id
52
- })['modelErrorAnalysisPredictionImports' ][0 ]['id' ]
53
- client .execute (
54
- """mutation deleteModelErrorAnalysisPredictionImportPyApi($import_id: ID!) {
55
- deleteModelErrorAnalysisPredictionImport(where: {id: $import_id}) {
56
- id
57
- }}""" , {"import_id" : import_id })
58
-
59
-
60
- def test_create_from_local_file (client , tmp_path ,
61
- model_run_with_model_run_data_rows ,
37
+ annotation_import .wait_until_done ()
38
+
39
+
40
+ def test_create_from_local_file (tmp_path , model_run_with_model_run_data_rows ,
62
41
object_predictions ,
63
42
annotation_import_test_helpers ):
64
43
name = str (uuid .uuid4 ())
@@ -74,17 +53,7 @@ def test_create_from_local_file(client, tmp_path,
74
53
annotation_import_test_helpers .check_running_state (annotation_import , name )
75
54
annotation_import_test_helpers .assert_file_content (
76
55
annotation_import .input_file_url , object_predictions )
77
- import_id = client .execute (
78
- """query get_mea_importPyApi($model_run_id: ID!) {
79
- modelErrorAnalysisPredictionImports(where: {modelRunId: $model_run_id}) {
80
- id
81
- }}""" , {"model_run_id" : annotation_import .parent_id
82
- })['modelErrorAnalysisPredictionImports' ][0 ]['id' ]
83
- client .execute (
84
- """mutation deleteModelErrorAnalysisPredictionImportPyApi($import_id: ID!) {
85
- deleteModelErrorAnalysisPredictionImport(where: {id: $import_id}) {
86
- id
87
- }}""" , {"import_id" : import_id })
56
+ annotation_import .wait_until_done ()
88
57
89
58
90
59
def test_get (client , model_run_with_model_run_data_rows ,
@@ -100,17 +69,7 @@ def test_get(client, model_run_with_model_run_data_rows,
100
69
assert annotation_import .model_run_id == model_run_with_model_run_data_rows .uid
101
70
annotation_import_test_helpers .check_running_state (annotation_import , name ,
102
71
url )
103
- import_id = client .execute (
104
- """query get_mea_importPyApi($model_run_id: ID!) {
105
- modelErrorAnalysisPredictionImports(where: {modelRunId: $model_run_id}) {
106
- id
107
- }}""" , {"model_run_id" : annotation_import .parent_id
108
- })['modelErrorAnalysisPredictionImports' ][0 ]['id' ]
109
- client .execute (
110
- """mutation deleteModelErrorAnalysisPredictionImportPyApi($import_id: ID!) {
111
- deleteModelErrorAnalysisPredictionImport(where: {id: $import_id}) {
112
- id
113
- }}""" , {"import_id" : import_id })
72
+ annotation_import .wait_until_done ()
114
73
115
74
116
75
@pytest .mark .slow
0 commit comments