def testGetExternalConfiguration(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)
    self.mox.StubOutWithMock(self.settings, '_TranslateValue')

    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)
    mock_fh.close()
    mock_cp.items('settings').AndReturn(
        (('name2', 'value2'), ('name', 'value')))
    self.settings._TranslateValue('value2').AndReturn('value2')
    self.settings._TranslateValue('value').AndReturn('value')

    self.mox.ReplayAll()
    self.assertEqual(
        {'name2': 'value2', 'name': 'value'},
        self.settings._GetExternalConfiguration(
            'name', as_file=False,
            open_=mock_open, isdir_=mock_isdir, join_=mock_join))
    self.mox.VerifyAll()
Send append data from files to servers.
dataset/ETHPy150Open google/simian/src/tests/simian/settings_test.py/FilesystemSettingsTest.testGetExternalConfiguration--crossover with--dataset/ETHPy150Open openstack/bareon/contrib/fuel_bootstrap/files/trusty/usr/bin/send2syslog.py/WatchedGroup.send