10
10
"""
11
11
12
12
13
- def test_create_from_url (model_run_with_model_run_data_rows ,
13
+ def test_create_from_url (client , 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,9 +19,20 @@ def test_create_from_url(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
-
23
-
24
- def test_create_from_objects (model_run_with_model_run_data_rows ,
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 ,
25
36
object_predictions ,
26
37
annotation_import_test_helpers ):
27
38
name = str (uuid .uuid4 ())
@@ -33,9 +44,21 @@ def test_create_from_objects(model_run_with_model_run_data_rows,
33
44
annotation_import_test_helpers .check_running_state (annotation_import , name )
34
45
annotation_import_test_helpers .assert_file_content (
35
46
annotation_import .input_file_url , object_predictions )
36
-
37
-
38
- def test_create_from_local_file (tmp_path , model_run_with_model_run_data_rows ,
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 ,
39
62
object_predictions ,
40
63
annotation_import_test_helpers ):
41
64
name = str (uuid .uuid4 ())
@@ -51,6 +74,17 @@ def test_create_from_local_file(tmp_path, model_run_with_model_run_data_rows,
51
74
annotation_import_test_helpers .check_running_state (annotation_import , name )
52
75
annotation_import_test_helpers .assert_file_content (
53
76
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 })
54
88
55
89
56
90
def test_get (client , model_run_with_model_run_data_rows ,
@@ -66,6 +100,17 @@ def test_get(client, model_run_with_model_run_data_rows,
66
100
assert annotation_import .model_run_id == model_run_with_model_run_data_rows .uid
67
101
annotation_import_test_helpers .check_running_state (annotation_import , name ,
68
102
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 })
69
114
70
115
71
116
@pytest .mark .slow
0 commit comments