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)
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)
def can_read_tab_element(): element = xml_element("w:tab") tab = _read_and_get_document_xml_element(element) assert_equal(documents.tab(), tab)
def docx_tab_is_converted_to_tab_in_html(): result = convert_document_element_to_html(documents.tab()) assert_equal('\t', result.value)
def tab_element_is_converted_to_tab_character(): element = documents.tab() result = extract_raw_text_from_element(element) assert_equal("\t", result)