How to use the todoman.configuration.load_config function in todoman

To help you get started, we’ve selected a few todoman examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pimutils / todoman / tests / test_config.py View on Github external
def test_colour_validation_always(config):
    config.write("color = 'always'\n", 'a')
    with patch(
        'todoman.configuration.find_config',
        return_value=(str(config)),
    ):
        cfg = load_config()

    assert cfg['main']['color'] == 'always'
github pimutils / todoman / tests / test_config.py View on Github external
def test_colour_validation_auto(config):
    with patch(
        'todoman.configuration.find_config',
        return_value=(str(config)),
    ):
        cfg = load_config()

    assert cfg['main']['color'] == 'auto'
github pimutils / todoman / tests / test_config.py View on Github external
def test_colour_validation_invalid(config):
    config.write("color = 'on_weekends_only'\n", 'a')
    with patch(
        'todoman.configuration.find_config',
        return_value=(str(config)),
    ), pytest.raises(ConfigurationException):
        load_config()
github pimutils / todoman / todoman / cli.py View on Github external
def init_config(self):
        try:
            self.config = load_config()
        except ConfigurationException as e:
            raise click.ClickException(e.args[0])