Пример #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")