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)
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)
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)