def it_can_change_its_text(self, text_set_fixture): p, value, expected_xml = text_set_fixture paragraph = _Paragraph(p, None) paragraph.text = value assert paragraph._element.xml == expected_xml
def it_knows_what_text_it_contains(self, text_get_fixture): p, expected_value = text_get_fixture paragraph = _Paragraph(p, None) text = paragraph.text assert text == expected_value assert is_unicode(text)
def paragraph(self, p_bldr): return _Paragraph(p_bldr.element, None)
def text_set_fixture(self, request): p_cxml, new_value, expected_p_cxml = request.param paragraph = _Paragraph(element(p_cxml), None) expected_xml = xml(expected_p_cxml) return paragraph, new_value, expected_xml
def text_get_fixture(self, request): p_cxml, expected_value = request.param paragraph = _Paragraph(element(p_cxml), None) return paragraph, expected_value
def runs_fixture(self): p_cxml = 'a:p/(a:r/a:t"Foo",a:r/a:t"Bar",a:r/a:t"Baz")' paragraph = _Paragraph(element(p_cxml), None) expected_text = ('Foo', 'Bar', 'Baz') return paragraph, expected_text
def clear_fixture(self, request): p_cxml, expected_p_cxml = request.param paragraph = _Paragraph(element(p_cxml), None) expected_xml = xml(expected_p_cxml) return paragraph, expected_xml
def line_break_fixture(self, request): cxml, expected_cxml = request.param paragraph = _Paragraph(element(cxml), None) expected_xml = xml(expected_cxml) return paragraph, expected_xml
def before_set_fixture(self, request): p_cxml, new_value, expected_p_cxml = request.param paragraph = _Paragraph(element(p_cxml), None) expected_xml = xml(expected_p_cxml) return paragraph, new_value, expected_xml
def before_get_fixture(self, request): p_cxml, expected_value = request.param paragraph = _Paragraph(element(p_cxml), None) return paragraph, expected_value
def runs_fixture(self): p_cxml = 'a:p/(a:r/a:t"Foo",a:r/a:t"Bar",a:r/a:t"Baz")' paragraph = _Paragraph(element(p_cxml), None) expected_text = ("Foo", "Bar", "Baz") return paragraph, expected_text