|
13 | 13 | class TestGetAnnotations(BaseTestCase): |
14 | 14 | PROJECT_NAME = "Test-get_annotations" |
15 | 15 | FOLDER_NAME = "Test-get_annotations" |
| 16 | + FOLDER_NAME_2 = "Test-get_annotations_2" |
16 | 17 | PROJECT_DESCRIPTION = "Desc" |
17 | 18 | PROJECT_TYPE = "Vector" |
18 | 19 | TEST_FOLDER_PATH = "data_set/sample_project_vector" |
@@ -57,6 +58,30 @@ def test_get_annotations_by_ids(self): |
57 | 58 |
|
58 | 59 | self.assertEqual(len(annotations), 4) |
59 | 60 |
|
| 61 | + def test_get_annotations_by_ids_with_duplicate_names(self): |
| 62 | + sa.create_folder(self.PROJECT_NAME, self.FOLDER_NAME_2) |
| 63 | + self._attach_items(count=4, folder=self.FOLDER_NAME_2) # noqa |
| 64 | + self._attach_items(count=4) # noqa |
| 65 | + |
| 66 | + sa.create_annotation_classes_from_classes_json( |
| 67 | + self.PROJECT_NAME, f"{self.folder_path}/classes/classes.json" |
| 68 | + ) |
| 69 | + _, _, _ = sa.upload_annotations_from_folder_to_project( |
| 70 | + self.PROJECT_NAME, self.folder_path |
| 71 | + ) |
| 72 | + _, _, _ = sa.upload_annotations_from_folder_to_project( |
| 73 | + f"{self.PROJECT_NAME}/{self.FOLDER_NAME_2}", self.folder_path |
| 74 | + ) |
| 75 | + items = sa.search_items(self.PROJECT_NAME) |
| 76 | + folder_items = sa.search_items(f"{self.PROJECT_NAME}/{self.FOLDER_NAME_2}") |
| 77 | + all_items = items + folder_items |
| 78 | + |
| 79 | + annotations = sa.get_annotations( |
| 80 | + self._project["id"], [i["id"] for i in all_items] |
| 81 | + ) |
| 82 | + |
| 83 | + self.assertEqual(len(annotations), 8) |
| 84 | + |
60 | 85 | def test_get_annotations_by_wrong_item_ids(self): |
61 | 86 | annotations = sa.get_annotations(self._project["id"], [1, 2, 3]) |
62 | 87 |
|
|
0 commit comments