Beispiel #1
0
    def test_load(self):
        config = Config()
        filename = os.path.join(os.path.abspath(os.path.dirname(__file__)), "config_file.py")

        config.from_file(filename)

        self.assertTrue(config['SOME_TEST_VAR'], 'some_test_value')
Beispiel #2
0
    def test_load(self):
        config = Config()
        filename = os.path.join(os.path.abspath(os.path.dirname(__file__)),
                                "config_file.py")

        config.from_file(filename)

        self.assertTrue(config['SOME_TEST_VAR'], 'some_test_value')
Beispiel #3
0
    def run(self, options, args):
        """Prepare env befor command execution

        :param options: options object
        :param args: list or commandor args
        """

        if not options.config:
            return False

        config = Config()

        # Load default config
        config.from_module(gottwall.default_config)

        # Rewrite default settings
        config.from_file(options.config)

        return config
Beispiel #4
0
    def run(self, options, args):
        """Prepare env befor command execution

        :param options: options object
        :param args: list or commandor args
        """

        if not options.config:
            return False

        config = Config()

        # Load default config
        config.from_module(gottwall.default_config)

        # Rewrite default settings
        config.from_file(options.config)

        return config