コード例 #1
0
 def test_should_not_fail_with_empty_document(self):
     structured_document = SimpleStructuredDocument()
     annotate_structured_document_using_predicted_images(
         structured_document, [])
コード例 #2
0
 def test_should_return_empty_token_list_if_document_has_no_lines(self):
     structured_document = SimpleStructuredDocument(
         SimplePage([], bounding_box=PAGE_BOUNDING_BOX))
     assert list(
         structured_document_to_token_props(structured_document)) == []
コード例 #3
0
 def test_should_return_single_token_text(self):
     structured_document = SimpleStructuredDocument(
         SimplePage([SimpleLine([SimpleToken(TEXT_1)])],
                    bounding_box=PAGE_BOUNDING_BOX))
     result = list(structured_document_to_token_props(structured_document))
     assert [t.get('text') for t in result] == [TEXT_1]
コード例 #4
0
 def test_should_return_empty_token_list_if_document_has_no_pages(self):
     structured_document = SimpleStructuredDocument([])
     assert list(
         structured_document_to_token_props(structured_document)) == []