def test_to_html_with_source_text(self): """ Tests that when to_html() is called on a valid object with an output file path defined, that the outputted HTML file is created (thus, that the method ran to completion). """ if isfile(self.html_output_file_path): raise BaseException("This test requires that the html output file does not exist when the test is" " initiated, but it already exists.") annotations = Annotations(self.ann_file_path_one, annotation_type='ann', source_text_path=self.ann_file_one_source_path) annotations.to_html(self.html_output_file_path) self.assertTrue(isfile(self.html_output_file_path))
def test_to_html_no_source_text(self): """Tests that when to_html() is called on an annotation with no source_text_path, it throws ValueError.""" annotations = Annotations(self.ann_file_path_one, annotation_type='ann') with self.assertRaises(ValueError): annotations.to_html(self.html_output_file_path)