示例#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"
示例#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)
示例#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"