@@ -17,9 +17,8 @@ def test_create_from_url(configured_project):
17
17
name = str (uuid .uuid4 ())
18
18
url = "https://storage.googleapis.com/labelbox-public-bucket/predictions_test_v2.ndjson"
19
19
20
- bulk_import_request = configured_project .upload_annotations (name = name ,
21
- annotations = url ,
22
- validate = False )
20
+ bulk_import_request = configured_project .upload_annotations (
21
+ name = name , annotations = url , validate = False )
23
22
24
23
assert bulk_import_request .project () == configured_project
25
24
assert bulk_import_request .name == name
@@ -126,9 +125,8 @@ def test_wait_till_done(rectangle_inference, configured_project):
126
125
url = configured_project .client .upload_data (content = ndjson .dumps (
127
126
[rectangle_inference ]),
128
127
sign = True )
129
- bulk_import_request = configured_project .upload_annotations (name = name ,
130
- annotations = url ,
131
- validate = False )
128
+ bulk_import_request = configured_project .upload_annotations (
129
+ name = name , annotations = url , validate = False )
132
130
133
131
assert len (bulk_import_request .inputs ) == 1
134
132
bulk_import_request .wait_until_done ()
@@ -149,10 +147,16 @@ def assert_file_content(url: str, predictions):
149
147
assert response .text == ndjson .dumps (predictions )
150
148
151
149
152
- def test_delete (configured_project , predictions ):
150
+ def test_delete (client , configured_project , predictions ):
153
151
name = str (uuid .uuid4 ())
154
152
155
153
bulk_import_request = configured_project .upload_annotations (
156
154
name = name , annotations = predictions )
157
155
bulk_import_request .wait_til_done ()
158
156
bulk_import_request .delete ()
157
+
158
+ id_param = "project_id"
159
+ query_str = """query bulk_import_requests($%s: ID!) {bulkImportRequests(where: {projectId: $%s}) {id}}""" % (
160
+ id_param , id_param )
161
+ all_import_requests = client .execute (query_str , {id_param : project .uid })
162
+ assert len (all_import_requests ['bulkImportRequests' ]) == 0
0 commit comments