def test_get_config_bad_key(self): with self.assertRaises(KeyError): get_config('dela')
def test_get_config_bad_config(self): os.environ['FAILURE_INJECTION_PARAM'] = 'test.conf' with self.assertRaises(InvalidParameterError): get_config('delay')
def test_get_config_error_code(self): delay, rate = get_config('error_code') self.assertEqual(delay, 404) self.assertEqual(rate, 0.5)
def test_get_config_delay(self): delay, rate = get_config('delay') self.assertEqual(delay, 200) self.assertEqual(rate, 0.5)
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(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)