Skip to content

Commit 322f741

Browse files
committed
テストコードの追加
1 parent e31ae76 commit 322f741

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_local_parser.py

+14
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,20 @@ def test_lazy_parse_simple_annotation_zip_by_task(self):
114114
assert len([e for e in parser_list if e.input_data_id == "c86205d1-bdd4-4110-ae46-194e661d622b"]) == 1
115115

116116

117+
def test_lazy_parse_simple_annotation_dir_by_task(self):
118+
zip_path = Path(test_dir / "simple-annotation-v2")
119+
task_parser_list = list(annofabapi.parser.lazy_parse_simple_annotation_dir_by_task(zip_path))
120+
121+
assert len(task_parser_list) == 2
122+
assert len([e for e in task_parser_list if e.task_id == "sample_1"]) == 1
123+
assert len([e for e in task_parser_list if e.task_id == "sample_0"]) == 1
124+
125+
task_parser = [e for e in task_parser_list if e.task_id == "sample_1"][0]
126+
parser_list = task_parser.parser_list
127+
assert len(parser_list) == 2
128+
assert len([e for e in parser_list if e.input_data_id == "c6e1c2ec-6c7c-41c6-9639-4244c2ed2839"]) == 1
129+
assert len([e for e in parser_list if e.input_data_id == "c86205d1-bdd4-4110-ae46-194e661d622b"]) == 1
130+
117131
class TestFullAnnotation:
118132
def test_full_annotation_zip(self):
119133
zip_path = Path(test_dir / "full-annotation.zip")

0 commit comments

Comments
 (0)