def METHOD_NAME(self):
    """ Testing function that gets class source from ipython kernel"""
    # Test normal case
    result = fed_utils.get_ipython_class_file(TestClass)
    self.assertTrue(os.path.isfile(result), 'The result of class_file is not a file')
    with patch.object(fedbiomed.common.utils._utils, 'hasattr') as mock_hasattr:
        mock_hasattr.return_value = False
        with self.assertRaises(FedbiomedError):
            fed_utils.get_ipython_class_file(TestClass)
    with patch.object(sys, 'modules') as mock_sys_modules:
        mock_sys_modules.return_value = {}
        result = fed_utils.get_ipython_class_file(TestClass)
        self.assertTrue(os.path.isfile(result), 'The result of class_file is not a file')