Example #1
0
 def test_get_config_bad_config(self):
     os.environ['CHAOS_PARAM'] = 'test.conf'
     with self.assertRaises(InvalidParameterError):
         get_config('delay')
Example #2
0
 def test_get_config(self):
     with self.assertRaises(KeyError):
         get_config('error_code')
Example #3
0
 def test_get_config_rate(self):
     rate, rate = get_config('rate')
     self.assertEqual(rate, 0.5)
     self.assertEqual(rate, 0.5)
Example #4
0
 def test_get_config_bad_key(self):
     with self.assertRaises(KeyError):
         get_config('dela')
Example #5
0
 def test_get_config_delay(self):
     delay, rate = get_config('delay')
     self.assertEqual(delay, 200)
     self.assertEqual(rate, 0.5)
Example #6
0
 def test_get_config_error_code(self):
     error_code, rate = get_config('error_code')
     self.assertEqual(error_code, 404)
     self.assertEqual(rate, 0.5)
Example #7
0
 def test_get_config(self):
     delay, rate = get_config('error_code')
     self.assertEqual(delay, 0)
     self.assertEqual(rate, 0)
Example #8
0
 def test_get_config(self):
     isEnabled, rate = get_config('isEnabled')
     self.assertEqual(isEnabled, True or False)
     self.assertEqual(rate, 0.5)
Example #9
0
 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')
Example #10
0
 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')
Example #11
0
 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)
Example #12
0
 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)
Example #13
0
 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)
Example #14
0
 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)
Example #15
0
 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)