Skip to content

Commit 7325b0a

Browse files
committed
Add test
1 parent c831c69 commit 7325b0a

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

tests/integration/annotations/test_annotation_adding.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,36 @@ def test_upload_annotations(self):
4747
self.PROJECT_NAME, self.folder_path
4848
)
4949

50+
51+
def test_add_point_to_empty_image(self):
52+
sa.upload_images_from_folder_to_project(
53+
self.PROJECT_NAME, self.folder_path, annotation_status="InProgress"
54+
)
55+
56+
sa.add_annotation_point_to_image(
57+
self.PROJECT_NAME, self.EXAMPLE_IMAGE_1, [250, 250], "test_add"
58+
)
59+
annotations_new = sa.get_image_annotations(
60+
self.PROJECT_NAME, self.EXAMPLE_IMAGE_1
61+
)["annotation_json"]
62+
63+
self.assertEqual(
64+
annotations_new["instances"][0], {
65+
'x': 250.0,
66+
'y': 250.0,
67+
'creationType': 'Preannotation',
68+
'className': 'test_add',
69+
'visible': True,
70+
'locked': False,
71+
'probability': 100,
72+
'attributes': [],
73+
'type': 'point',
74+
'pointLabels': {},
75+
'groupId': 0,
76+
'classId': -1
77+
})
78+
79+
5080
def test_add_bbox(self):
5181
sa.upload_images_from_folder_to_project(
5282
self.PROJECT_NAME, self.folder_path, annotation_status="InProgress"
@@ -92,8 +122,6 @@ def test_add_bbox(self):
92122
len(annotations["instances"]) + len(annotations["comments"]) + 3,
93123
)
94124

95-
export = sa.prepare_export(self.PROJECT_NAME, include_fuse=True)
96-
sa.download_export(self.PROJECT_NAME, export["name"], tmpdir_name)
97125

98126
def test_add_bbox_no_init(self):
99127
sa.upload_images_from_folder_to_project(

0 commit comments

Comments
 (0)