Example #1
0
    def test_definitions(self):
        renderer = MGWikiPageRenderer()
        info = MagicMock()
        info.definitions = ['def2', 'def1', 'def4']
        definitions = renderer.render_definitions(info, [])
        rendered_definitions = """
# def1
# def2
# def4"""
        self.assertEquals(definitions, rendered_definitions)
Example #2
0
    def test_definitions_with_link(self):
        renderer = MGWikiPageRenderer()
        info = MagicMock()
        links = ['def2', 'def1', 'ak']
        info.definitions = ['def2.', '[[def1]]', 'def4', 'mult ak']
        definitions = renderer.render_definitions(info, links)
        rendered_definitions = """
# [[def1]]
# [[def2|def2]].
# [[def4]]
# mult ak"""
        self.assertEquals(definitions, rendered_definitions)
Example #3
0
    def test_definitions_with_examples(self):
        renderer = MGWikiPageRenderer()
        info = MagicMock()
        info.additional_data = {}
        info.definitions = ['def1', 'def2', 'def4']
        info.additional_data['examples'] = [['exdef1'], ['exdef2', 'exdef22'],
                                            ['exdef4']]
        definitions = renderer.render_definitions(info, [])
        rendered_definitions = """
# def1
#* ''exdef1''
# def2
#* ''exdef2''
#* ''exdef22''
# def4
#* ''exdef4''"""
        self.assertEquals(definitions, rendered_definitions)