Esempio n. 1
0
 def test_data_access_attribute_with_text_class(self):
     datas = MyDatas({"test_info": "test text"})
     document = Document(datas)
     section = document.new_section()
     text_class = TextClass(section)
     text_class.text = text_class.free_text(text_class.test_info)
     assert str(text_class) == "test text"
Esempio n. 2
0
 def test_data_access_non_existing_attribute(self):
     datas = MyDatas({"test_info": "test text"})
     document = Document(datas)
     section = document.new_section()
     text_class = TextClass(section)
     with pytest.raises(AttributeError):
         text_class.text = text_class.free_text(text_class.test_missing)
Esempio n. 3
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"
Esempio n. 4
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() == ""
Esempio n. 5
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"
Esempio n. 6
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#"
Esempio n. 7
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"
Esempio n. 8
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*"
Esempio n. 9
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>"
Esempio n. 10
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"
Esempio n. 11
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"
Esempio n. 12
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"
Esempio n. 13
0
 def test_empty_text_class(self):
     document, section = create_empty_section()
     text_class = TextClass(section)
     assert str(text_class) == ""