def testGetExternalConfigurationAsFileWhenIoError(self):
    mock_open = self.mox.CreateMockAnything()
    mock_fh = self.mox.CreateMockAnything()
    mock_isdir = self.mox.CreateMockAnything()
    mock_join = self.mox.CreateMockAnything()

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

    mock_join(self.settings._path, 'name').AndReturn('/path/name')
    mock_open('/path/name', 'r').AndReturn(mock_fh)
    mock_fh.read().AndRaise(IOError)

    self.mox.ReplayAll()
    self.assertEqual(
        None, self.settings._GetExternalConfiguration(
            'name', as_file=True,
            open_=mock_open, isdir_=mock_isdir, join_=mock_join))
    self.mox.VerifyAll()
Render RSS feed with recent posts
dataset/ETHPy150Open google/simian/src/tests/simian/settings_test.py/FilesystemSettingsTest.testGetExternalConfigurationAsFileWhenIoError--crossover with--dataset/ETHPy150Open jkossen/imposter/frontend.py/show_rss