test_validate_config.py 944 B

1234567891011121314151617181920212223242526272829
  1. from flexmock import flexmock
  2. from borgmatic.commands import validate_config as module
  3. def test_parse_arguments_with_no_arguments_uses_defaults():
  4. config_paths = ['default']
  5. flexmock(module.collect).should_receive('get_default_config_paths').and_return(config_paths)
  6. parser = module.parse_arguments()
  7. assert parser.config_paths == config_paths
  8. def test_parse_arguments_with_multiple_config_paths_parses_as_list():
  9. flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default'])
  10. parser = module.parse_arguments('--config', 'myconfig', 'otherconfig')
  11. assert parser.config_paths == ['myconfig', 'otherconfig']
  12. def test_parse_arguments_supports_show_flag():
  13. config_paths = ['default']
  14. flexmock(module.collect).should_receive('get_default_config_paths').and_return(config_paths)
  15. parser = module.parse_arguments('--config', 'myconfig', '--show')
  16. assert parser.show