def test_must_raise_if_value_not_in_choice(self): os.environ[self.varname] = "Z" with self.assertRaises(click.UsageError): _get_mode_value_from_envvar(self.varname, self.choices)
def test_return_none_if_value_not_found(self): result = _get_mode_value_from_envvar(self.varname, self.choices) self.assertIsNone(result)
def test_must_get_value(self): os.environ[self.varname] = "A" result = _get_mode_value_from_envvar(self.varname, self.choices) self.assertEqual(result, "A")