def test_span(self): doc = Doc( Para( Span(classes=["tip", "listing"]), Span(classes=["tip"]), Span(classes=["warning"]), Span(classes=["v5.0"]), Span( attributes={ "latex-tip-icon": "warning", "latex-tip-position": "right", "latex-tip-size": 24, } ), ), metadata=self.metadata(), format="latex", api_version=(1, 17, 2), ) pandoc_latex_tip.main(doc) self.assertEqual(doc.content[0].content[1].format, "tex") self.assertEqual(doc.content[0].content[3].format, "tex") self.assertEqual(doc.content[0].content[5].format, "tex") self.assertEqual(doc.content[0].content[7].format, "tex") self.assertEqual(doc.content[0].content[9].format, "tex")
def test_codeblock(): doc = Doc(CodeBlock('', classes=['tip', 'listing']), CodeBlock('', classes=['tip']), CodeBlock('', classes=['warning']), CodeBlock('', attributes={ 'latex-tip-icon': 'warning', 'latex-tip-position': 'right', 'latex-tip-size': 24 }), metadata=metadata(), format='latex', api_version=(1, 17, 2)) pandoc_latex_tip.main(doc) assert doc.content[0].format == 'tex' assert doc.content[2].format == 'tex' assert doc.content[5].format == 'tex' assert doc.content[8].format == 'tex'
def test_div(): doc = Doc(Div(classes=['tip', 'listing']), Div(classes=['tip']), Div(classes=['warning']), Div( attributes={ 'latex-tip-icon': 'warning', 'latex-tip-position': 'right', 'latex-tip-size': 24 }), metadata=metadata(), format='latex', api_version=(1, 17, 2)) pandoc_latex_tip.main(doc) assert doc.content[0].format == 'tex' assert doc.content[2].format == 'tex' assert doc.content[4].format == 'tex' assert doc.content[6].format == 'tex'
def test_div(self): doc = Doc( Div(classes=["tip", "listing"]), Div(classes=["tip"]), Div(classes=["warning"]), Div( attributes={ "latex-tip-icon": "warning", "latex-tip-position": "right", "latex-tip-size": 24, }), metadata=self.metadata(), format="latex", api_version=(1, 17, 2), ) pandoc_latex_tip.main(doc) self.assertEqual(doc.content[0].format, "tex") self.assertEqual(doc.content[2].format, "tex") self.assertEqual(doc.content[4].format, "tex") self.assertEqual(doc.content[6].format, "tex")
def test_codeblock(self): doc = Doc( CodeBlock("", classes=["tip", "listing"]), CodeBlock("", classes=["tip"]), CodeBlock("", classes=["warning"]), CodeBlock( "", attributes={ "latex-tip-icon": "warning", "latex-tip-position": "right", "latex-tip-size": 24, }, ), metadata=self.metadata(), format="latex", ) pandoc_latex_tip.main(doc) self.assertEqual(doc.content[0].format, "tex") self.assertEqual(doc.content[2].format, "tex") self.assertEqual(doc.content[5].format, "tex") self.assertEqual(doc.content[8].format, "tex")
def test_div(self): doc = Doc( Div(classes=["tip", "listing"]), Div(classes=["tip"]), Div(classes=["warning"]), Div( attributes={ "latex-tip-icon": "warning", "latex-tip-position": "right", "latex-tip-size": 24, } ), metadata=self.metadata(), format="latex", api_version=(1, 17, 2), ) pandoc_latex_tip.main(doc) self.assertEqual(doc.content[0].format, "tex") self.assertEqual(doc.content[2].format, "tex") self.assertEqual(doc.content[4].format, "tex") self.assertEqual(doc.content[6].format, "tex")
def test_codeblock(self): doc = Doc( CodeBlock("", classes=["tip", "listing"]), CodeBlock("", classes=["tip"]), CodeBlock("", classes=["warning"]), CodeBlock( "", attributes={ "latex-tip-icon": "warning", "latex-tip-position": "right", "latex-tip-size": 24, }, ), metadata=self.metadata(), format="latex", api_version=(1, 17, 2), ) pandoc_latex_tip.main(doc) self.assertEqual(doc.content[0].format, "tex") self.assertEqual(doc.content[2].format, "tex") self.assertEqual(doc.content[5].format, "tex") self.assertEqual(doc.content[8].format, "tex")
def test_span(self): doc = Doc( Para( Span(classes=["tip", "listing"]), Span(classes=["tip"]), Span(classes=["warning"]), Span(classes=["v5.0"]), Span( attributes={ "latex-tip-icon": "warning", "latex-tip-position": "right", "latex-tip-size": 24, }), ), metadata=self.metadata(), format="latex", ) pandoc_latex_tip.main(doc) self.assertEqual(doc.content[0].content[1].format, "tex") self.assertEqual(doc.content[0].content[3].format, "tex") self.assertEqual(doc.content[0].content[5].format, "tex") self.assertEqual(doc.content[0].content[7].format, "tex") self.assertEqual(doc.content[0].content[9].format, "tex")
def test_code(self): doc = Doc( Para( Code("", classes=["tip", "listing"]), Code("", classes=["tip"]), Code("", classes=["warning"]), Code( "", attributes={ "latex-tip-icon": "warning", "latex-tip-position": "right", "latex-tip-size": 24, }, ), ), metadata=self.metadata(), format="latex", api_version=(1, 17, 2), ) pandoc_latex_tip.main(doc) self.assertEqual(doc.content[0].content[1].format, "tex") self.assertEqual(doc.content[0].content[3].format, "tex") self.assertEqual(doc.content[0].content[5].format, "tex") self.assertEqual(doc.content[0].content[7].format, "tex")