Ejemplo n.º 1
0
    def test_Parent_NoDoubleSet(self):
        parent = KeyedNode("parent")
        child = KeyedNode("child")
        child.set_parent(parent)

        imposter = KeyedNode("imposter")
        self.assertRaises(MultipleParentsNotSupported,
                          lambda: child.set_parent(imposter))

        self.assertEqual(child.get_parent(), parent)
Ejemplo n.º 2
0
    def test_Parent_CanSet(self):
        parent = KeyedNode("parent")
        child = KeyedNode("child")
        child.set_parent(parent)

        self.assertEqual(child.get_parent(), parent)
Ejemplo n.º 3
0
 def test_Parent_DefaultNone(self):
     child = KeyedNode("child")
     self.assertIsNone(child.get_parent())