def _get_setting(self, key, default=None): return get_setting(self.env, key, default)
def test_get_setting_with_default_value(self): getenv_mock = self._mock_os_get_env(None) self.assertEqual(1, get_setting(ENV, RABBIT_MQ_HOST, 1)) getenv_mock.assert_called_once_with(ACS_ENV_RABBIT_MQ_HOST)
def test_get_setting(self): getenv_mock = self._mock_os_get_env(TEST) self.assertEqual(TEST, get_setting(ENV, RABBIT_MQ_HOST)) getenv_mock.assert_called_once_with(ACS_ENV_RABBIT_MQ_HOST)
def test_get_setting_given_empty_value(self): getenv_mock = self._mock_os_get_env(None) self.assertEqual(None, get_setting(ENV, RABBIT_MQ_HOST)) getenv_mock.assert_called_once_with(ACS_ENV_RABBIT_MQ_HOST)
def test_get_setting(self): getenv_mock = self._mock_os_get_env('test') self.assertEqual('test', get_setting('ENV', 'RABBIT_MQ_HOST')) getenv_mock.assert_called_once_with('ACS_ENV_RABBIT_MQ_HOST')