Beispiel #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)
Beispiel #2
0
    def test_Parent_CanSet(self):
        parent = KeyedNode("parent")
        child = KeyedNode("child")
        child.set_parent(parent)

        self.assertEqual(child.get_parent(), parent)
Beispiel #3
0
 def test_Parent_DefaultNone(self):
     child = KeyedNode("child")
     self.assertIsNone(child.get_parent())