def test_import_not_exist(self): """Make sure that if module that doesn't exist is passed, that function catches ImportError and returns None. """ answer = solver.execute_problem(self.module_not_exist) self.assertEqual(answer, None)
def test_import_without_main(self): """Make sure that if module that doesn't have method main is passed, that function catches AttributeError and returns None. """ answer = solver.execute_problem(self.module_without_main) self.assertEqual(answer, None)
def test_import_with_main(self): """Make sure that module with method main is able to be imported and main method can be executed. We use problems.problem_0001 to test that this works, i.e. that no errors are raised. """ solver.execute_problem(self.module_with_main)