def test_bad_size(): metadata = { 'pandoc-latex-fontsize': MetaList( MetaMap( size=MetaString('BADSIZE'), classes=MetaList(MetaString('class1'), MetaString('class2')) ) ) } elem = Span(classes=['class1', 'class2']) doc = Doc(Para(elem), metadata=metadata, format='latex', api_version=(1, 17, 2)) pandoc_latex_fontsize.main(doc) assert isinstance(elem.content[0], RawInline) assert elem.content[0].format == 'tex' assert elem.content[0].text == '\\normalsize '
def test_bad_size(self): metadata = { "pandoc-latex-fontsize": MetaList( MetaMap( size=MetaString("BADSIZE"), classes=MetaList(MetaString("class1"), MetaString("class2")), )) } elem = Span(classes=["class1", "class2"]) doc = Doc(Para(elem), metadata=metadata, format="latex") pandoc_latex_fontsize.main(doc) self.assertIsInstance(elem.content[0], RawInline) self.assertEqual(elem.content[0].format, "tex") self.assertEqual(elem.content[0].text, "\\normalsize ")
def codeblock(self, elem, doc): pandoc_latex_fontsize.main(doc) self.opening(doc.content[0], RawBlock) self.closing(doc.content[2], RawBlock)
def code(self, elem, doc): pandoc_latex_fontsize.main(doc) self.opening(doc.content[0].content[0], RawInline) self.closing(doc.content[0].content[2], RawInline)
def div(self, elem, doc): pandoc_latex_fontsize.main(doc) self.opening(elem.content[0], RawBlock) self.closing(elem.content[1], RawBlock)
def span(self, elem, doc, size): pandoc_latex_fontsize.main(doc) self.assertIsInstance(elem.content[0], RawInline) self.assertEqual(elem.content[0].format, "tex") self.assertEqual(elem.content[0].text, "\\" + size + " ")
def codeblock(elem, doc): pandoc_latex_fontsize.main(doc) opening(doc.content[0], RawBlock) closing(doc.content[2], RawBlock)
def code(elem, doc): pandoc_latex_fontsize.main(doc) opening(doc.content[0].content[0], RawInline) closing(doc.content[0].content[2], RawInline)
def div(elem, doc): pandoc_latex_fontsize.main(doc) opening(elem.content[0], RawBlock) closing(elem.content[1], RawBlock)
def span(elem, doc, size): pandoc_latex_fontsize.main(doc) assert isinstance(elem.content[0], RawInline) assert elem.content[0].format == 'tex' assert elem.content[0].text == '\\' + size + ' '