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"