def unexpected_table_children_do_not_cause_error():
    table = documents.table([
        documents.tab(),
    ])
    result = convert_document_element_to_html(table)
    expected_html = "<table>\t</table>"
    assert_equal(expected_html, result.value)
示例#2
0
def unexpected_table_children_do_not_cause_error():
    table = documents.table([
        documents.tab(),
    ])
    result = convert_document_element_to_html(table)
    expected_html = "<table>\t</table>"
    assert_equal(expected_html, result.value)
示例#3
0
 def can_read_tab_element(self):
     element = xml_element("w:tab")
     tab = _read_and_get_document_xml_element(element)
     assert_equal(documents.tab(), tab)
 def filters_descendants_to_type(self):
     tab = documents.tab()
     run = documents.run(children=[])
     element = documents.paragraph(children=[tab, run])
     assert_equal([run], get_descendants_of_type(element, documents.Run))
 def returns_nothing_if_element_type_has_no_children(self):
     assert_equal([], get_descendants(documents.tab()))
 def non_paragraph_elements_are_not_transformed(self):
     paragraph = documents.paragraph(children=[])
     result = transforms.run(lambda _: documents.tab())(paragraph)
     assert_equal(documents.paragraph(children=[]), result)
 def run_is_transformed(self):
     run = documents.run(children=[])
     result = transforms.run(lambda _: documents.tab())(run)
     assert_equal(documents.tab(), result)
 def paragraph_is_transformed(self):
     paragraph = documents.paragraph(children=[])
     result = transforms.paragraph(lambda _: documents.tab())(paragraph)
     assert_equal(documents.tab(), result)
示例#9
0
 def paragraph_is_transformed(self):
     paragraph = documents.paragraph(children=[])
     result = transforms.paragraph(lambda _: documents.tab())(paragraph)
     assert_equal(documents.tab(), result)
示例#10
0
def can_read_tab_element():
    element = xml_element("w:tab")
    tab = _read_and_get_document_xml_element(element)
    assert_equal(documents.tab(), tab)
示例#11
0
 def filters_descendants_to_type(self):
     tab = documents.tab()
     run = documents.run(children=[])
     element = documents.paragraph(children=[tab, run])
     assert_equal([run], get_descendants_of_type(element, documents.Run))
示例#12
0
 def returns_nothing_if_element_type_has_no_children(self):
     assert_equal([], get_descendants(documents.tab()))
示例#13
0
 def non_paragraph_elements_are_not_transformed(self):
     paragraph = documents.paragraph(children=[])
     result = transforms.run(lambda _: documents.tab())(paragraph)
     assert_equal(documents.paragraph(children=[]), result)
示例#14
0
 def run_is_transformed(self):
     run = documents.run(children=[])
     result = transforms.run(lambda _: documents.tab())(run)
     assert_equal(documents.tab(), result)
def docx_tab_is_converted_to_tab_in_html():
    result = convert_document_element_to_html(documents.tab())
    assert_equal('\t', result.value)
def docx_tab_is_converted_to_tab_in_html():
    result = convert_document_element_to_html(documents.tab())
    assert_equal('\t', result.value)
示例#17
0
def tab_element_is_converted_to_tab_character():
    element = documents.tab()

    result = extract_raw_text_from_element(element)

    assert_equal("\t", result)