def test_nested_title_markup(self): transformer = directives.TransformNextSlides(self.document) transformer.apply_to_document( self.document, env=MagicMock(), building_slides=True, ) self.assertEqual( str(self.document.traverse(nodes.section)[1][0]), '<title><strong>Title</strong></title>', )
def test_next_slide_transformer_ignores_nonslide_builds(self): self.assertEqual( len(self.document.traverse(nodes.section)), 1, ) transformer = directives.TransformNextSlides(self.document) transformer.apply_to_document( self.document, env=MagicMock(), building_slides=False, ) self.assertEqual( len(self.document.traverse(nodes.section)), 1, )
def test_next_slide_creates_new_sections(self): self.assertEqual( len(self.document.traverse(nodes.section)), 1, ) transformer = directives.TransformNextSlides(self.document) transformer.apply_to_document( self.document, env=MagicMock(), building_slides=True, ) self.assertEqual( len(self.document.traverse(nodes.section)), 2, ) self.assertIn( 'extra-class', self.document.traverse(nodes.section)[-1].get('classes'), )