@@ -159,7 +159,9 @@ def test_check_inputs(self, mock_checkfile, mock_isfile, mock_isdir, mock_args):
159159 @patch ("funannotate2.annotate.os.path.isdir" )
160160 @patch ("funannotate2.annotate.os.path.isfile" )
161161 @patch ("funannotate2.annotate.checkfile" )
162- def test_check_inputs_missing_files (self , mock_checkfile , mock_isfile , mock_isdir , mock_args ):
162+ def test_check_inputs_missing_files (
163+ self , mock_checkfile , mock_isfile , mock_isdir , mock_args
164+ ):
163165 """Test the check_inputs function with missing files."""
164166 # Set up mocks
165167 mock_isdir .return_value = True
@@ -170,7 +172,9 @@ def test_check_inputs_missing_files(self, mock_checkfile, mock_isfile, mock_isdi
170172 # Instead, the input validation is done directly in the annotate function
171173 # This test is skipped until the function is implemented
172174
173- @pytest .mark .skip (reason = "find_input_files function not implemented in annotate module" )
175+ @pytest .mark .skip (
176+ reason = "find_input_files function not implemented in annotate module"
177+ )
174178 @patch ("funannotate2.annotate.find_files" )
175179 def test_find_input_files (self , mock_find_files , mock_args ):
176180 """Test the find_input_files function."""
@@ -199,21 +203,29 @@ def test_parse_annotations(self):
199203
200204 try :
201205 # Call the function
202- result = annotate .parse_annotations (temp_name )
206+ result , parse_errors = annotate .parse_annotations (temp_name )
203207
204208 # Check the result
205209 assert isinstance (result , dict )
210+ assert isinstance (parse_errors , dict )
206211 assert "gene1" in result
207212 assert "gene2" in result
208213 assert "product" in result ["gene1" ]
209214 assert "db_xref" in result ["gene1" ]
210215 assert result ["gene1" ]["product" ] == ["Hypothetical protein" ]
211216 assert result ["gene1" ]["db_xref" ] == ["UniProtKB/Swiss-Prot:P12345" ]
217+
218+ # Check that parsing was successful (no errors)
219+ assert len (parse_errors ["malformed_lines" ]) == 0
220+ assert parse_errors ["parsed_lines" ] == 4 # 4 lines in the test file
221+ assert parse_errors ["total_lines" ] == 4
212222 finally :
213223 # Clean up
214224 os .unlink (temp_name )
215225
216- @pytest .mark .skip (reason = "write_output_files function not implemented in annotate module" )
226+ @pytest .mark .skip (
227+ reason = "write_output_files function not implemented in annotate module"
228+ )
217229 @patch ("funannotate2.annotate.os.path.join" )
218230 @patch ("funannotate2.annotate.os.makedirs" )
219231 @patch ("funannotate2.annotate.dict2tbl" )
0 commit comments