def test_deleteuser_exception(self):
     portal = Portal('http://localhost:8090/iportal', 'admin', 'Supermap123')
     portal._portal = mock.MagicMock()
     managment = mock.MagicMock()
     portal._portal.security_management = mock.MagicMock(return_value=managment)
     re = MethodResult()
     managment.delete_user = mock.MagicMock(return_value=re)
     with self.assertRaises(Exception):
         portal.delete_user('test')
     managment.delete_user.assert_called_once()
 def test_deleteuser(self):
     portal = Portal('http://localhost:8090/iportal', 'admin', 'Supermap123')
     portal._portal = mock.MagicMock()
     managment = mock.MagicMock()
     portal._portal.security_management = mock.MagicMock(return_value=managment)
     re = MethodResult()
     re.succeed = True
     managment.delete_user = mock.MagicMock(return_value=re)
     portal.delete_user('test')
     managment.delete_user.assert_called_once()