Mark all required fields for config. Throw if no input_* field specified

- Add custom validator to throw if neither input_filter or
  input_<files|directories> are specified

- Set field expecting paths to type Path

- Now that default_config isn't used in code. We can update
  fields in rawconfig to specify whether they're required or not.
  This lets pydantic validate config file and throw appropriate error
This commit is contained in:
Debanjum Singh Solanky
2022-08-04 23:26:31 +03:00
parent f78d6ae754
commit 1374065092
2 changed files with 25 additions and 13 deletions

View File

@@ -40,5 +40,5 @@ def test_cli_config_from_file():
assert actual_args.config_file == Path('tests/data/config.yml')
assert actual_args.regenerate == True
assert actual_args.config is not None
assert actual_args.config.content_type.org.input_files == ['~/first_from_config.org', '~/second_from_config.org']
assert actual_args.config.content_type.org.input_files == [Path('~/first_from_config.org'), Path('~/second_from_config.org')]
assert actual_args.verbose == 3