Exemplo n.º 1
0
 def test_bad_set_parent(self):
     aSection = Section('aTitle', 1)
     anotherSection = Section('AnotherTitle', 2)
     self.assertIsNone(aSection.get_parent())
     with self.assertRaises(Exception):
         aSection.set_parent(anotherSection)
Exemplo n.º 2
0
 def test_set_parent(self):
     aSection = Section('aTitle', 1)
     anotherSection = Section('AnotherTitle', 2)
     self.assertIsNone(anotherSection.get_parent())
     anotherSection.set_parent(aSection)
     self.assertIsNotNone(anotherSection.get_parent())