Ejemplo n.º 1
0
 def test_render_rst_with_type(self):
     node = Arg(5, 'bar')
     node.type = 'str'
     rst = node.render_rst()
     self.assertEqual(rst, ['     :param bar: ',
                            '     :type bar: str',
                            ''])
Ejemplo n.º 2
0
 def test_render_rst_with_child(self):
     node = Arg(5, 'bar')
     child = Node(indent=10, lines=["Description"], parent=node)
     node.add_child(child)
     rst = node.render_rst()
     self.assertEqual(rst, ['     :param bar: Description',
                            ''])
Ejemplo n.º 3
0
 def test_render_rst_with_children(self):
     node = Arg(5, 'bar')
     child_a = Node(indent=10, lines=["ChildA"], parent=node)
     node.add_child(child_a)
     child_b = Node(indent=10, lines=["ChildB"], parent=node)
     node.add_child(child_b)
     rst = node.render_rst()
     self.assertEqual(rst,
                      ['     :param bar: ChildA', '          ChildB', ''])
Ejemplo n.º 4
0
 def test_render_rst_with_children(self):
     node = Arg(5, 'bar')
     child_a = Node(indent=10, lines=["ChildA"], parent=node)
     node.add_child(child_a)
     child_b = Node(indent=10, lines=["ChildB"], parent=node)
     node.add_child(child_b)
     rst = node.render_rst()
     self.assertEqual(rst, ['     :param bar: ChildA',
                            '          ChildB',
                            ''])
Ejemplo n.º 5
0
 def test_render_rst_with_type(self):
     node = Arg(5, 'bar')
     node.type = 'str'
     rst = node.render_rst()
     self.assertEqual(rst, ['     :param bar: ', '     :type bar: str', ''])
Ejemplo n.º 6
0
 def test_render_rst_with_child(self):
     node = Arg(5, 'bar')
     child = Node(indent=10, lines=["Description"], parent=node)
     node.add_child(child)
     rst = node.render_rst()
     self.assertEqual(rst, ['     :param bar: Description', ''])
Ejemplo n.º 7
0
 def test_render_rst_empty(self):
     node = Arg(5, 'bar')
     rst = node.render_rst()
     self.assertEqual(rst, ['     :param bar: ', ''])
Ejemplo n.º 8
0
 def test_render_rst_empty(self):
     node = Arg(5, 'bar')
     rst = node.render_rst()
     self.assertEqual(rst, ['     :param bar: ',
                            ''])