示例#1
0
 def test_inexistent_params(self):
     config = Config()
     with self.assertRaises(AttributeError):
         config["souveniers"]
     with self.assertRaises(AttributeError):
         config.souveniers
     with self.assertRaises(AttributeError):
         config.get("souveniers")
示例#2
0
 def test_set(self):
     config = Config()
     config.set("app_name", "test2")
     self.assertEqual(config.get("app_name"), "test2")
     self.assertEqual(config.app_name, "test2")
     self.assertEqual(config["app_name"], "test2")
示例#3
0
 def test_get(self):
     config = Config()
     self.assertEqual(config.get("app_name"), "test")