def test_reset(self): conf = Config() conf.defaults.add_section("player") conf.defaults.set("player", "backend", "blah") conf.set("player", "backend", "foo") self.assertEqual(conf.get("player", "backend"), "foo") conf.reset("player", "backend") self.assertEqual(conf.get("player", "backend"), "blah")
def test_reset(self): conf = Config() conf.defaults.add_section("player") conf.defaults.set("player", "backend", "blah") conf.set("player", "backend", "foo") self.assertEqual(conf.get("player", "backend"), "foo") conf.reset("player", "backend") self.assertEqual(conf.get("player", "backend"), "blah")
def test_initial_after_set(self): conf = Config() conf.add_section("player") conf.set("player", "backend", "orig") conf.defaults.set("player", "backend", "initial") self.assertEqual(conf.get("player", "backend"), "orig") self.assertEqual(conf.defaults.get("player", "backend"), "initial") conf.reset("player", "backend") self.assertEqual(conf.get("player", "backend"), "initial")
def test_initial_after_set(self): conf = Config() conf.add_section("player") conf.set("player", "backend", "orig") conf.defaults.set("player", "backend", "initial") self.assertEqual(conf.get("player", "backend"), "orig") self.assertEqual(conf.defaults.get("player", "backend"), "initial") conf.reset("player", "backend") self.assertEqual(conf.get("player", "backend"), "initial")
def test_reset_no_section(self): conf = Config() conf.defaults.add_section("player") conf.defaults.set("player", "backend", "blah") conf.reset("player", "backend") assert conf.get("player", "backend") == "blah"
def test_reset_no_section(self): conf = Config() conf.defaults.add_section("player") conf.defaults.set("player", "backend", "blah") conf.reset("player", "backend") assert conf.get("player", "backend") == "blah"