test_generate_config.py 803 B

12345678910111213141516171819202122232425
  1. from borgmatic.commands import generate_config as module
  2. def test_parse_arguments_with_no_arguments_uses_default_destination():
  3. parser = module.parse_arguments()
  4. assert parser.destination_filename == module.DEFAULT_DESTINATION_CONFIG_FILENAME
  5. def test_parse_arguments_with_destination_argument_overrides_default():
  6. parser = module.parse_arguments('--destination', 'config.yaml')
  7. assert parser.destination_filename == 'config.yaml'
  8. def test_parse_arguments_parses_source():
  9. parser = module.parse_arguments('--source', 'source.yaml', '--destination', 'config.yaml')
  10. assert parser.source_filename == 'source.yaml'
  11. def test_parse_arguments_parses_overwrite():
  12. parser = module.parse_arguments('--destination', 'config.yaml', '--overwrite')
  13. assert parser.overwrite