Ejemplo n.º 1
0
    def test_add(self):
        config = Config()

        new_file = open(CONFIG_FILENAME, "w")
        new_file.write("[this]\n\tthat = true\n")
        new_file.write("[something \"other\"]\n\there = false")
        new_file.close()

        config.add_file(CONFIG_FILENAME, 0)
        assert 'this.that' in config
        assert config.get_bool('this.that')
        assert 'something.other.here' in config
        assert not config.get_bool('something.other.here')
Ejemplo n.º 2
0
    def test_add(self):
        config = Config()

        new_file = open(CONFIG_FILENAME, "w")
        new_file.write("[this]\n\tthat = true\n")
        new_file.write("[something \"other\"]\n\there = false")
        new_file.close()

        config.add_file(CONFIG_FILENAME, 0)
        self.assertTrue('this.that' in config)
        self.assertTrue(config['this.that'])
        self.assertTrue('something.other.here' in config)
        self.assertFalse(config['something.other.here'])