class_docstr: Unit tests for the CodeManager class
class_docstr_tok: ["Unit","tests","for","the","CodeManager","class"]
code: def test_clean_code_raise_bad_import_error(
      self, code_manager: CodeManager, exec_context: MagicMock
  ):
      malicious_code = """
  import os
  print(os.listdir())
  """
      with pytest.raises(BadImportError):
          code_manager.execute_code(malicious_code, exec_context)
  
imports: import ast
  from typing import Optional
  from unittest.mock import MagicMock, Mock, patch
  import uuid
  import pandas
  import pytest
  from pandasai.connectors.base import SQLConnectorConfig
  from pandasai.connectors.sql import PostgreSQLConnector, SQLConnector
  from pandasai.exceptions import BadImportError, MaliciousQueryError, NoCodeFoundError
  from pandasai.helpers.skills_manager import SkillsManager
  from pandasai.llm.fake import FakeLLM
  from pandasai.exceptions import InvalidConfigError
  from pandasai.smart_dataframe import SmartDataframe
  from pandasai.helpers.code_manager import CodeExecutionContext, CodeManager
label_desc: Use image node_id 14 for calling the TestCodeManager obj's underlying member method code with example usage: obj.test_clean_code_raise_bad_import_error(code_manager, exec_context) without return types