Skip to content

Commit 40678b5

Browse files
committed
Rename test filename
1 parent 929279d commit 40678b5

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

tests/test_single_annotation_upload_download.py renamed to tests/test_single_annotation_download.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
from pathlib import Path
21
import filecmp
32
import json
3+
from pathlib import Path
44

55
import pytest
66

77
import superannotate as sa
88

9-
sa.init(Path.home() / ".superannotate" / "config.json")
10-
11-
PROJECT_NAME = "testing_1419"
12-
139

1410
@pytest.mark.parametrize(
1511
"project_type,name,description,from_folder", [
@@ -31,16 +27,30 @@ def test_annotation_download_upload(
3127
projects = sa.search_projects(name, return_metadata=True)
3228
for project in projects:
3329
sa.delete_project(project)
30+
3431
project = sa.create_project(name, description, project_type)
32+
3533
sa.upload_images_from_folder_to_project(
3634
project, from_folder, annotation_status="NotStarted"
3735
)
3836
sa.create_annotation_classes_from_classes_json(
3937
project, from_folder / "classes" / "classes.json"
4038
)
4139
sa.upload_annotations_from_folder_to_project(project, from_folder)
40+
4241
image = sa.search_images(project)[2]
43-
sa.download_image_annotations(project, image, tmpdir)
42+
paths = sa.download_image_annotations(project, image, tmpdir)
43+
44+
input_annotation_paths_after = sa.image_path_to_annotation_paths(
45+
tmpdir / image, project_type
46+
)
47+
48+
assert paths[0] == str(input_annotation_paths_after[0])
49+
if project_type == "Pixel":
50+
assert paths[1] == str(input_annotation_paths_after[1])
51+
else:
52+
assert len(paths) == 1
53+
4454
anns_json_in_folder = list(Path(tmpdir).glob("*.json"))
4555
anns_mask_in_folder = list(Path(tmpdir).glob("*.png"))
4656
assert len(anns_json_in_folder) == 1
@@ -61,4 +71,3 @@ def test_annotation_download_upload(
6171
assert filecmp.cmp(
6272
input_annotation_paths[1], anns_mask_in_folder[0], shallow=False
6373
)
64-
# sa.download_image_preannotations(image, tmpdir)

0 commit comments

Comments
 (0)