From 9ca31530a0d06196f2e3a64fb7c47ff05f89bf7d Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 20 Apr 2023 23:15:22 -0700 Subject: [PATCH] Add missing test for check_all_source_directories_exist() raising. --- tests/unit/borg/test_create.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit/borg/test_create.py b/tests/unit/borg/test_create.py index 5011f48..3728a0b 100644 --- a/tests/unit/borg/test_create.py +++ b/tests/unit/borg/test_create.py @@ -2580,3 +2580,11 @@ def test_check_all_source_directories_exist_with_glob_and_tilde_directories(): flexmock(module.os.path).should_receive('exists').with_args('/root/bar').and_return(True) module.check_all_source_directories_exist(['foo*', '~/bar']) + + +def test_check_all_source_directories_exist_with_non_existent_directory_raises(): + flexmock(module).should_receive('expand_directory').with_args('foo').and_return(('foo',)) + flexmock(module.os.path).should_receive('exists').and_return(False) + + with pytest.raises(ValueError): + module.check_all_source_directories_exist(['foo'])