def test_document_add_section(self): document, section = create_empty_section() document.write_section(section) expected = "\n".join([ '<html>', '<head>', '<meta charset="utf-8">', '<title></title>', '<link rel="stylesheet" href="css/styles.css">', '</head>', '<body><div id="text_area"><div></div></div></body>', '</html>\n', ]) assert str(document) == expected
def test_text_class_free_text(self): document, section = create_empty_section() text_class = TextClass(section) text_class.text = text_class.free_text("test") assert str(text_class) == "test"
def test_text_class_no_interpret(self): document, section = create_empty_section() text_class = TextClass(section) text_class.text = text_class.no_interpret(" ") assert str(text_class) == "#SPACE#"
def test_text_class_iter_elems(self): document, section = create_empty_section() text_class = TextClass(section) text_class.text = text_class.nlg_iter([["iter", "elem"]]) assert str(text_class) == "iter et elem"
def test_text_class_synonym(self): document, section = create_empty_section() text_class = TextClass(section) text_class.text = text_class.nlg_syn(["syno"]) assert str(text_class) == "*1*"
def test_text_class_number(self): document, section = create_empty_section() text_class = TextClass(section) text_class.text = text_class.nlg_num(154) assert str(text_class) == "154"
def test_text_class_nlg_tag(self): document, section = create_empty_section() text_class = TextClass(section) text_class.text = text_class.nlg_tags("b", "test") assert str(text_class) == "<b>test</b>"
def test_get_html_text_write_section(self): document, section = create_empty_section() section.text = "test_text" section.write() assert str(section) == "<div>Test_text</div>\n"
def test_text_class_list(self): document, section = create_empty_section() text_class = TextClass(section) text_class.text = ["test", "test"] assert str(text_class) == "test test"
def test_text_class_text_2(self): document, section = create_empty_section() text_class = TextClass(section) text_class.text = "test" text_class.text = "test" assert str(text_class) == "test test"
def test_empty_text_class(self): document, section = create_empty_section() text_class = TextClass(section) assert str(text_class) == ""
def test_get_html_write_document(self): document, section = create_empty_section() section.text = "test_text" document.write_section(section) assert str(section.text) == ""
def test_get_text_write_section(self): document, section = create_empty_section() section.text = "test_text" section.write() assert str(section.text) == ""
def test_get_text(self): document, section = create_empty_section() section.text = "test_text" assert str(section.text) == "test_text"
def test_get_html_text(self): document, section = create_empty_section() section.text = "test_text" assert str(section) == "<div></div>\n"
def test_text_class_post_eval(self): document, section = create_empty_section() text_class = TextClass(section) text_class.text = text_class.post_eval("TEST", "test", "") section.write() assert section.html.xpath('//div')[0].text_content() == ""
def test_text_class_write_get_section_text(self): document, section = create_empty_section() text_class = TextClass(section) text_class.text = "test" text_class.text = "test" assert str(section.text) == "test test"
def test_empty_section(self): document, section = create_empty_section() assert str(section) == "<div></div>\n"