|
25 | 25 | """ |
26 | 26 |
|
27 | 27 |
|
28 | | -def test_create_from_url(configured_project): |
| 28 | +def test_create_from_url(project): |
29 | 29 | name = str(uuid.uuid4()) |
30 | 30 | url = "https://storage.googleapis.com/labelbox-public-bucket/predictions_test_v2.ndjson" |
31 | 31 |
|
32 | | - bulk_import_request = configured_project.upload_annotations(name=name, |
33 | | - annotations=url, |
34 | | - validate=False) |
| 32 | + bulk_import_request = project.upload_annotations(name=name, |
| 33 | + annotations=url, |
| 34 | + validate=False) |
35 | 35 |
|
36 | | - assert bulk_import_request.project() == configured_project |
| 36 | + assert bulk_import_request.project() == project |
37 | 37 | assert bulk_import_request.name == name |
38 | 38 | assert bulk_import_request.input_file_url == url |
39 | 39 | assert bulk_import_request.error_file_url is None |
40 | 40 | assert bulk_import_request.status_file_url is None |
41 | 41 | assert bulk_import_request.state == BulkImportRequestState.RUNNING |
42 | 42 |
|
43 | 43 |
|
44 | | -def test_validate_file(configured_project): |
| 44 | +def test_validate_file(project_with_ontology): |
45 | 45 | name = str(uuid.uuid4()) |
46 | 46 | url = "https://storage.googleapis.com/labelbox-public-bucket/predictions_test_v2.ndjson" |
47 | 47 | with pytest.raises(MALValidationError): |
48 | | - configured_project.upload_annotations(name=name, |
49 | | - annotations=url, |
50 | | - validate=True) |
| 48 | + project_with_ontology.upload_annotations(name=name, |
| 49 | + annotations=url, |
| 50 | + validate=True) |
51 | 51 | #Schema ids shouldn't match |
52 | 52 |
|
53 | 53 |
|
54 | | -def test_create_from_objects(configured_project, predictions, |
| 54 | +def test_create_from_objects(configured_project_without_data_rows, predictions, |
55 | 55 | annotation_import_test_helpers): |
56 | 56 | name = str(uuid.uuid4()) |
57 | 57 |
|
58 | | - bulk_import_request = configured_project.upload_annotations( |
| 58 | + bulk_import_request = configured_project_without_data_rows.upload_annotations( |
59 | 59 | name=name, annotations=predictions) |
60 | 60 |
|
61 | | - assert bulk_import_request.project() == configured_project |
| 61 | + assert bulk_import_request.project() == configured_project_without_data_rows |
62 | 62 | assert bulk_import_request.name == name |
63 | 63 | assert bulk_import_request.error_file_url is None |
64 | 64 | assert bulk_import_request.status_file_url is None |
@@ -105,17 +105,17 @@ def test_create_from_local_file(tmp_path, predictions, configured_project, |
105 | 105 | bulk_import_request.input_file_url, predictions) |
106 | 106 |
|
107 | 107 |
|
108 | | -def test_get(client, configured_project): |
| 108 | +def test_get(client, configured_project_without_data_rows): |
109 | 109 | name = str(uuid.uuid4()) |
110 | 110 | url = "https://storage.googleapis.com/labelbox-public-bucket/predictions_test_v2.ndjson" |
111 | | - configured_project.upload_annotations(name=name, |
112 | | - annotations=url, |
113 | | - validate=False) |
| 111 | + configured_project_without_data_rows.upload_annotations(name=name, |
| 112 | + annotations=url, |
| 113 | + validate=False) |
114 | 114 |
|
115 | 115 | bulk_import_request = BulkImportRequest.from_name( |
116 | | - client, project_id=configured_project.uid, name=name) |
| 116 | + client, project_id=configured_project_without_data_rows.uid, name=name) |
117 | 117 |
|
118 | | - assert bulk_import_request.project() == configured_project |
| 118 | + assert bulk_import_request.project() == configured_project_without_data_rows |
119 | 119 | assert bulk_import_request.name == name |
120 | 120 | assert bulk_import_request.input_file_url == url |
121 | 121 | assert bulk_import_request.error_file_url is None |
@@ -158,14 +158,13 @@ def test_validate_ndjson_uuid(tmp_path, configured_project, predictions): |
158 | 158 |
|
159 | 159 |
|
160 | 160 | @pytest.mark.slow |
161 | | -def test_wait_till_done(rectangle_inference, configured_project): |
| 161 | +def test_wait_till_done(rectangle_inference, |
| 162 | + configured_project_without_data_rows): |
162 | 163 | name = str(uuid.uuid4()) |
163 | | - url = configured_project.client.upload_data(content=parser.dumps( |
164 | | - [rectangle_inference]), |
165 | | - sign=True) |
166 | | - bulk_import_request = configured_project.upload_annotations(name=name, |
167 | | - annotations=url, |
168 | | - validate=False) |
| 164 | + url = configured_project_without_data_rows.client.upload_data( |
| 165 | + content=parser.dumps([rectangle_inference]), sign=True) |
| 166 | + bulk_import_request = configured_project_without_data_rows.upload_annotations( |
| 167 | + name=name, annotations=url, validate=False) |
169 | 168 |
|
170 | 169 | assert len(bulk_import_request.inputs) == 1 |
171 | 170 | bulk_import_request.wait_until_done() |
|
0 commit comments