Beispiel #1
0
 def test_parent_changed(self):
     """Test if objects have the correct parent set after having it changed.
     """
     old_parent = Node(None)
     new_parent = Node(None)
     child = Node(old_parent)
     child.set_parent(new_parent)
     self.assertIs(child.parent(), new_parent)
Beispiel #2
0
 def test_no_parent(self):
     """Test that game objects with no parent return None for their parent.
     """
     obj = Node(None)
     self.assertIs(obj.parent(), None)
Beispiel #3
0
 def test_parent(self):
     """Test if objects have the correct parent set upon instantiation."""
     parent = Node(None)
     child = Node(parent)
     self.assertIs(child.parent(), parent)