Exemple #1
0
 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
Exemple #2
0
 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"
Exemple #3
0
 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#"
Exemple #4
0
 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"
Exemple #5
0
 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*"
Exemple #6
0
 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"
Exemple #7
0
 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>"
Exemple #8
0
 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"
Exemple #9
0
 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"
Exemple #10
0
 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"
Exemple #11
0
 def test_empty_text_class(self):
     document, section = create_empty_section()
     text_class = TextClass(section)
     assert str(text_class) == ""
Exemple #12
0
 def test_get_html_write_document(self):
     document, section = create_empty_section()
     section.text = "test_text"
     document.write_section(section)
     assert str(section.text) == ""
Exemple #13
0
 def test_get_text_write_section(self):
     document, section = create_empty_section()
     section.text = "test_text"
     section.write()
     assert str(section.text) == ""
Exemple #14
0
 def test_get_text(self):
     document, section = create_empty_section()
     section.text = "test_text"
     assert str(section.text) == "test_text"
Exemple #15
0
 def test_get_html_text(self):
     document, section = create_empty_section()
     section.text = "test_text"
     assert str(section) == "<div></div>\n"
Exemple #16
0
 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() == ""
Exemple #17
0
 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"
Exemple #18
0
 def test_empty_section(self):
     document, section = create_empty_section()
     assert str(section) == "<div></div>\n"