def test_get_config_bad_config(self): os.environ['CHAOS_PARAM'] = 'test.conf' with self.assertRaises(InvalidParameterError): get_config('delay')
def test_get_config(self): with self.assertRaises(KeyError): get_config('error_code')
def test_get_config_rate(self): rate, rate = get_config('rate') self.assertEqual(rate, 0.5) self.assertEqual(rate, 0.5)
def test_get_config_bad_key(self): with self.assertRaises(KeyError): get_config('dela')
def test_get_config_delay(self): delay, rate = get_config('delay') self.assertEqual(delay, 200) self.assertEqual(rate, 0.5)
def test_get_config_error_code(self): error_code, rate = get_config('error_code') self.assertEqual(error_code, 404) self.assertEqual(rate, 0.5)
def test_get_config(self): delay, rate = get_config('error_code') self.assertEqual(delay, 0) self.assertEqual(rate, 0)
def test_get_config(self): isEnabled, rate = get_config('isEnabled') self.assertEqual(isEnabled, True or False) self.assertEqual(rate, 0.5)
def test_get_config_bad_config(self): method_name = sys._getframe().f_code.co_name self._setTestUp(method_name) os.environ['CHAOS_PARAM'] = 'test.conf' with self.assertRaises(InvalidParameterError): get_config('delay')
def test_get_config(self): method_name = sys._getframe().f_code.co_name self._setTestUp(method_name) with self.assertRaises(KeyError): get_config('error_code')
def test_get_config_rate(self): method_name = sys._getframe().f_code.co_name self._setTestUp(method_name) rate, rate = get_config('rate') self.assertEqual(rate, 0.5) self.assertEqual(rate, 0.5)
def test_get_config_error_code(self): method_name = sys._getframe().f_code.co_name self._setTestUp(method_name) error_code, rate = get_config('error_code') self.assertEqual(error_code, 404) self.assertEqual(rate, 0.5)
def test_get_config_delay(self): method_name = sys._getframe().f_code.co_name self._setTestUp(method_name) delay, rate = get_config('delay') self.assertEqual(delay, 200) self.assertEqual(rate, 0.5)
def test_get_config(self): method_name = sys._getframe().f_code.co_name self._setTestUp(method_name) isEnabled, rate = get_config('isEnabled') self.assertEqual(isEnabled, True or False) self.assertEqual(rate, 0.5)
def test_get_config(self): method_name = sys._getframe().f_code.co_name self._setTestUp(method_name) delay, rate = get_config('error_code') self.assertEqual(delay, 0) self.assertEqual(rate, 0)