Example #1
0
 def test_unknown_param(self):
     """Configuration, unknown parameter"""
     
     with self.assertRaisesRegexp(GlobalConfigError, "unknown parameter"):
         Config.parse({
             "bad": 1
         })
Example #2
0
    def test_wrong_type(self):
        """Configuration, wrong type"""

        with self.assertRaisesRegexp(GlobalConfigError, "invalid type for dir"):
            Config.parse({
                "ip_cache": {
                    "dir": 1
                }
            })
Example #3
0
    def test_basic(self):
        """Configuration, basic test"""
        Config.parse({
            "ip_cache": {
                "dir": "test"
            }
        })

        self.assertEquals(
            Config.get("ip_cache.dir"),
            "test"
        )