code: def test_solaris_enable_shared(self):
      dist = Distribution({"name": "xx"})
      cmd = build_ext(dist)
      old = sys.platform
  
      sys.platform = "sunos"  # fooling finalize_options
      from distutils.sysconfig import _config_vars
  
      old_var = _config_vars.get("Py_ENABLE_SHARED")
      _config_vars["Py_ENABLE_SHARED"] = 1
      try:
          cmd.ensure_finalized()
      finally:
          sys.platform = old
          if old_var is None:
              del _config_vars["Py_ENABLE_SHARED"]
          else:
              _config_vars["Py_ENABLE_SHARED"] = old_var
  
      # make sure we get some library dirs under solaris
      self.assertGreater(len(cmd.library_dirs), 0)
  
imports: import sys
  import os
  from StringIO import StringIO
  import textwrap
  from distutils.core import Extension, Distribution
  from distutils.command.build_ext import build_ext
  from distutils import sysconfig
  from distutils.tests import support
  from distutils.errors import DistutilsSetupError, CompileError, DistutilsPlatformError
  import unittest
  from test import test_support
label_desc: Use image node_id 4 for calling the BuildExtTestCase obj's underlying member method code with example usage: obj.test_solaris_enable_shared() without return types