def test_ignores_whitespace_in_probability_variable(self):
     self.os.environ.get.return_value = " \n0.1 "
     p = chaos.get_default_probability()
     self.assertEqual(p, 0.1)
 def test_returns_default_if_no_probability_variable(self):
     self.os.environ.get.return_value = ""
     p = chaos.get_default_probability()
     self.assertEqual(p, chaos.DEFAULT_PROBABILITY)
 def test_returns_float_value_of_probability_variable(self):
     for s in ("0.1", "0.2", "0.3"):
         self.os.environ.get.return_value = s
         p = chaos.get_default_probability()
         self.assertEqual(p, float(s))
 def test_looks_for_a_probability_environment_variable(self):
     self.os.environ.get.return_value = ""
     chaos.get_default_probability()
     self.os.environ.get.assert_called_once_with("probability", "")
 def test_ignores_whitespace_in_probability_variable(self):
     self.os.environ.get.return_value = " \n0.1 "
     p = chaos.get_default_probability()
     self.assertEqual(p, 0.1)
 def test_returns_float_value_of_probability_variable(self):
     for s in ("0.1", "0.2", "0.3"):
         self.os.environ.get.return_value = s
         p = chaos.get_default_probability()
         self.assertEqual(p, float(s))
 def test_returns_default_if_no_probability_variable(self):
     self.os.environ.get.return_value = ""
     p = chaos.get_default_probability()
     self.assertEqual(p, chaos.DEFAULT_PROBABILITY)
 def test_looks_for_a_probability_environment_variable(self):
     self.os.environ.get.return_value = ""
     chaos.get_default_probability()
     self.os.environ.get.assert_called_once_with("probability", "")