def test_style(self): """ Get an automatic style with getStyleByName """ textdoc = OpenDocumentText() boldstyle = style.Style(name=u'Bold', family=u"text") boldstyle.addElement(style.TextProperties(fontweight=u"bold")) textdoc.automaticstyles.addElement(boldstyle) s = textdoc.getStyleByName(u'Bold') self.assertEqual((u'urn:oasis:names:tc:opendocument:xmlns:style:1.0', 'style'), s.qname)
def test_style(self): """ Get an automatic style with getStyleByName """ textdoc = OpenDocumentText() boldstyle = style.Style(name='Bold', family="text") boldstyle.addElement(style.TextProperties(fontweight="bold")) textdoc.automaticstyles.addElement(boldstyle) s = textdoc.getStyleByName('Bold') self.assertEquals((u'urn:oasis:names:tc:opendocument:xmlns:style:1.0', 'style'), s.qname)
def test_style(self): """ Get a common style with getStyleByName """ textdoc = OpenDocumentText() tablecontents = style.Style(name=u"Table Contents", family=u"paragraph") tablecontents.addElement(style.ParagraphProperties(numberlines=u"false", linenumber=u"0")) textdoc.styles.addElement(tablecontents) s = textdoc.getStyleByName(u'Table Contents') self.assertEqual((u'urn:oasis:names:tc:opendocument:xmlns:style:1.0', 'style'), s.qname)
def test_style(self): """ Get a common style with getStyleByName """ textdoc = OpenDocumentText() tablecontents = style.Style(name="Table Contents", family="paragraph") tablecontents.addElement(style.ParagraphProperties(numberlines="false", linenumber="0")) textdoc.styles.addElement(tablecontents) s = textdoc.getStyleByName('Table Contents') self.assertEquals((u'urn:oasis:names:tc:opendocument:xmlns:style:1.0', 'style'), s.qname)