def test_isOrphanNode_check_parent(self): """Tests _isOrphanNode method""" _node = Node(None) _node_to_check = self._createNode(4, 'something') setattr(_node_to_check, 'parentNode', None) with patch.object(Node, '_isOrphanNode', wraps=_node._isOrphanNode) as _mock: _result = _node._isOrphanNode(_node_to_check) self.assertTrue(_result) self.assertListEqual( _mock.call_args_list, [call(_node_to_check), call(None)]) self.assertEqual(_mock.call_count, 2)
def test_isOrphanNode_Document_Node(self): """Tests _isOrphanNode method""" _node = Node(None) _node_to_check = self._createNode(9, 'something') _result = _node._isOrphanNode(_node_to_check) self.assertFalse(_result)
def test_isOrphanNode_None(self): """Tests _isOrphanNode method""" _node = Node(None) _result = _node._isOrphanNode(None) self.assertTrue(_result)