Esempio n. 1
0
 def test_render_rst_with_child(self):
     node = Except(5, 'FooError')
     child = Node(indent=10, lines=["Description"], parent=node)
     node.add_child(child)
     rst = node.render_rst()
     self.assertEqual(rst, ['     * FooError - Description',
                            ''])
Esempio n. 2
0
 def test_render_rst_with_child(self):
     node = Except(5, 'FooError')
     child = Node(indent=10, lines=["Description"], parent=node)
     node.add_child(child)
     rst = node.render_rst()
     self.assertEqual(rst, ['     * FooError - Description',
                            ''])
Esempio n. 3
0
 def test_add_two_children(self):
     node = Except(5, 'FooError')
     child0 = Node(parent=node)
     child1 = Node(parent=node)
     node.add_child(child0)
     node.add_child(child1)
     self.assertIs(node.children[0], child0)
     self.assertIs(node.children[1], child1)
Esempio n. 4
0
 def test_add_two_children(self):
     node = Except(5, 'FooError')
     child0 = Node(parent=node)
     child1 = Node(parent=node)
     node.add_child(child0)
     node.add_child(child1)
     self.assertIs(node.children[0], child0)
     self.assertIs(node.children[1], child1)
Esempio n. 5
0
 def test_render_rst_with_children(self):
     node = Except(5, 'FooError')
     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,
                      ['     * FooError - ChildA', '          ChildB', ''])
Esempio n. 6
0
 def test_render_rst_with_children(self):
     node = Except(5, 'FooError')
     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, ['     * FooError - ChildA',
                            '          ChildB',
                            ''])
Esempio n. 7
0
 def test_render_rst_indent(self):
     node = Except(5, 'FooError')
     rst = node.render_rst()
     self.assertEqual(rst, ['     * FooError - ',
                            ''])
Esempio n. 8
0
 def test_add_one_child(self):
     node = Except(5, 'FooError')
     child = Node(parent=node)
     node.add_child(child)
     self.assertIs(node.children[0], child)
Esempio n. 9
0
 def test_render_rst_indent(self):
     node = Except(5, 'FooError')
     rst = node.render_rst()
     self.assertEqual(rst, ['     * FooError - ',
                            ''])
Esempio n. 10
0
 def test_repr(self):
     node = Except(5,'FooError')
     actual = repr(node)
     expected = "Except('FooError', children=[])"
     self.assertEqual(expected, actual)
Esempio n. 11
0
 def test_add_one_child(self):
     node = Except(5, 'FooError')
     child = Node(parent=node)
     node.add_child(child)
     self.assertIs(node.children[0], child)
Esempio n. 12
0
 def test_create(self):
     node = Except(5, 'FooError')
     self.assertEqual(node.indent, 5)
     self.assertEqual(node.type, 'FooError')
     self.assertEqual(node.lines, [])
     self.assertIsNone(node.parent)