def testGetExternalConfigurationWhenConfigParserError(self):
    mock_open = self.mox.CreateMockAnything()
    mock_fh = self.mox.CreateMockAnything()
    mock_cp = self.mox.CreateMockAnything()
    mock_isdir = self.mox.CreateMockAnything()
    mock_join = self.mox.CreateMockAnything()
    self.mox.StubOutWithMock(settings.ConfigParser, 'ConfigParser', True)

    mock_isdir(self.settings._path).AndReturn(True)

    mock_join(self.settings._path, 'name').AndReturn('/path/name')
    mock_open('/path/name.cfg', 'r').AndReturn(mock_fh)
    settings.ConfigParser.ConfigParser().AndReturn(mock_cp)
    mock_cp.readfp(mock_fh).AndRaise(settings.ConfigParser.Error)

    self.mox.ReplayAll()
    self.assertEqual(
        None,
        self.settings._GetExternalConfiguration(
            'name', as_file=False,
            open_=mock_open, isdir_=mock_isdir, join_=mock_join))
    self.mox.VerifyAll()
Test _GetExternalConfiguration() when as_file=False and CP.Error.
dataset/ETHPy150Open google/simian/src/tests/simian/settings_test.py/FilesystemSettingsTest.testGetExternalConfigurationWhenConfigParserError