def test_cmdline_value_is_used(self): cmdline_mock = mock.Mock cmdline_mock.option = "cmdline value" value = gft._get_config_value("option", cmdline_mock, {"option": "value 0"}, default="default", required=True) self.assertEqual("cmdline value", value)
def test_default_can_be_specified(self): value = gft._get_config_value("option", {}, {}, default="default") self.assertEqual("default", value)
def test_config_file_value_is_used(self): value = gft._get_config_value("option", {}, {"option": "value 0"}, default="default", required=True) self.assertEqual("value 0", value)
def test_undefined_values_return_none(self): value = gft._get_config_value("unknown", {}, {}) self.assertEqual(None, value)