code: def testConfiguration(self, findConfigFile, environ):
      configuration.Configuration.clear()
      findConfigFile.side_effect = self.files.get
      with open(self.files["nupic-default.xml"], "w") as fp:
          with open(
              resource_filename(__name__, "conf/testFile1.xml")
          ) as inp:
              fp.write(inp.read())
      with open(self.files["nupic-site.xml"], "w") as fp:
          with open(
              resource_filename(__name__, "conf/testFile2.xml")
          ) as inp:
              fp.write(inp.read())
  
      env = {"USER": "foo", "HOME": "bar"}
      environ.__getitem__.side_effect = env.__getitem__
      environ.get.side_effect = env.get
      environ.__contains__.side_effect = env.__contains__
      environ.keys.side_effect = env.keys
  
      # Test the resulting configuration
      self.assertEqual(
          configuration.Configuration.get("database.host"), "TestHost"
      )
      self.assertEqual(
          configuration.Configuration.get("database.password"), "pass"
      )
      self.assertEqual(
          configuration.Configuration.get("database.emptypassword"), ""
      )
      self.assertEqual(
          configuration.Configuration.get("database.missingfield"), None
      )
      self.assertEqual(
          configuration.Configuration.get("database.user"), "root"
      )
  
      expectedValue = "foo"
      actualValue = configuration.Configuration.get(
          "var.environment.standalone.user"
      )
      self.assertTrue(
          actualValue == expectedValue,
          "expected %r, but got %r" % (expectedValue, actualValue),
      )
  
      expectedValue = "The user " + os.environ["USER"] + " rocks!"
      actualValue = configuration.Configuration.get(
          "var.environment.user.in.the.middle"
      )
      self.assertTrue(
          actualValue == expectedValue,
          "expected %r, but got %r" % (expectedValue, actualValue),
      )
  
      expectedValue = (
          "User "
          + os.environ["USER"]
          + " and home "
          + os.environ["HOME"]
          + " in the middle"
      )
      actualValue = configuration.Configuration.get(
          "var.environment.user.and.home.in.the.middle"
      )
      self.assertTrue(
          actualValue == expectedValue,
          "expected %r, but got %r" % (expectedValue, actualValue),
      )
  
      env["NTA_CONF_PROP_database_host"] = "FooBar"
  
      self.assertEqual(
          configuration.Configuration.get("database.host"), "FooBar"
      )
      allProps = configuration.Configuration.dict()
      self.assertTrue(allProps["database.host"] == "FooBar")
      del env["NTA_CONF_PROP_database_host"]
      environ.__getitem__.side_effect = env.__getitem__
      environ.get.side_effect = env.get
      environ.__contains__.side_effect = env.__contains__
  
      # Change a property
      configuration.Configuration.set("database.host", "matrix")
      self.assertEqual(
          configuration.Configuration.get("database.host"), "matrix"
      )
  
imports: from copy import copy
  import os
  import shutil
  from StringIO import StringIO
  import sys
  import tempfile
  import unittest2
  import uuid
  from pkg_resources import resource_filename
  from mock import Mock, patch
  from pkg_resources import resource_filename
  from xml.parsers.expat import ExpatError
  import nupic
  import nupic.support.configuration_custom
  import configuration_test
label_desc: Use image node_id 45 for calling the ConfigurationCustomTest obj's underlying member method code with example usage: obj.testConfiguration(findConfigFile, environ) without return types