code: def setUp(self):
      # force the test to use a special config object
      class FakeConfig:
          def Exists(self, arg):
              return True
  
          def Read(self, arg):
              return None
  
          def Write(self, arg, val):
              pass
  
          def GetEntryType(self, kwd):
              return 1
  
      self.old_headless = cellprofiler_core.preferences.__dict__[
          "__is_headless"
      ]
      self.old_headless_config = cellprofiler_core.preferences.__dict__[
          "__headless_config"
      ]
      cellprofiler_core.preferences.__dict__["__is_headless"] = True
      cellprofiler_core.preferences.__dict__[
          "__headless_config"
      ] = FakeConfig()
  
file_path: CellProfiler/tests/core/preferences/test_preferences.py
imports: import tempfile
  import unittest
  import cellprofiler_core.preferences
label_desc: Use image node_id 1 for calling the TestPreferences_02 obj's underlying member method code with example usage: obj.setUp() and returns: True, None, int