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"
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)
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_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_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_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_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_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_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_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_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) == ""