Exemple #1
0
 def test_get_config_bad_key(self):
     with self.assertRaises(KeyError):
         get_config('dela')
Exemple #2
0
 def test_get_config_bad_config(self):
     os.environ['FAILURE_INJECTION_PARAM'] = 'test.conf'
     with self.assertRaises(InvalidParameterError):
         get_config('delay')
Exemple #3
0
 def test_get_config_error_code(self):
     delay, rate = get_config('error_code')
     self.assertEqual(delay, 404)
     self.assertEqual(rate, 0.5)
Exemple #4
0
 def test_get_config_delay(self):
     delay, rate = get_config('delay')
     self.assertEqual(delay, 200)
     self.assertEqual(rate, 0.5)
Exemple #5
0
 def test_get_config(self):
     isEnabled, rate = get_config('isEnabled')
     self.assertEqual(isEnabled, True or False)
     self.assertEqual(rate, 0.5)
Exemple #6
0
 def test_get_config(self):
     with self.assertRaises(KeyError):
         get_config('error_code')
Exemple #7
0
 def test_get_config_rate(self):
     rate, rate = get_config('rate')
     self.assertEqual(rate, 0.5)
     self.assertEqual(rate, 0.5)