Fix several existing tests (#1105).

This commit is contained in:
Dan Helfman
2025-09-28 15:45:21 -07:00
parent 339186b579
commit 98ddb3e535
4 changed files with 39 additions and 0 deletions
@@ -76,6 +76,7 @@ def test_remove_data_source_dumps_deletes_manifest_and_parent_directory():
hook_config=None,
config={},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -92,6 +93,7 @@ def test_remove_data_source_dumps_with_dry_run_bails():
hook_config=None,
config={},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=True,
)
@@ -110,6 +112,7 @@ def test_remove_data_source_dumps_swallows_manifest_file_not_found_error():
hook_config=None,
config={},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -130,5 +133,6 @@ def test_remove_data_source_dumps_swallows_manifest_parent_directory_not_found_e
hook_config=None,
config={},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -773,6 +773,7 @@ def test_remove_data_source_dumps_deletes_snapshots():
hook_config=config['btrfs'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -790,6 +791,7 @@ def test_remove_data_source_dumps_without_hook_configuration_bails():
hook_config=None,
config={'source_directories': '/mnt/subvolume'},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -808,6 +810,7 @@ def test_remove_data_source_dumps_with_get_subvolumes_file_not_found_error_bails
hook_config=config['btrfs'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -828,6 +831,7 @@ def test_remove_data_source_dumps_with_get_subvolumes_called_process_error_bails
hook_config=config['btrfs'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -887,6 +891,7 @@ def test_remove_data_source_dumps_with_dry_run_skips_deletes():
hook_config=config['btrfs'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=True,
)
@@ -905,6 +910,7 @@ def test_remove_data_source_dumps_without_subvolumes_skips_deletes():
hook_config=config['btrfs'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -944,6 +950,7 @@ def test_remove_data_source_without_snapshots_skips_deletes():
hook_config=config['btrfs'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1003,6 +1010,7 @@ def test_remove_data_source_dumps_with_delete_snapshot_file_not_found_error_bail
hook_config=config['btrfs'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1064,6 +1072,7 @@ def test_remove_data_source_dumps_with_delete_snapshot_called_process_error_bail
hook_config=config['btrfs'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1107,5 +1116,6 @@ def test_remove_data_source_dumps_with_root_subvolume_skips_duplicate_removal():
hook_config=config['btrfs'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
+13
View File
@@ -912,6 +912,7 @@ def test_remove_data_source_dumps_unmounts_and_remove_snapshots():
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -928,6 +929,7 @@ def test_remove_data_source_dumps_bails_for_missing_lvm_configuration():
hook_config=None,
config={'source_directories': '/mnt/lvolume'},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -945,6 +947,7 @@ def test_remove_data_source_dumps_bails_for_missing_lsblk_command():
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -964,6 +967,7 @@ def test_remove_data_source_dumps_bails_for_lsblk_command_error():
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1010,6 +1014,7 @@ def test_remove_data_source_dumps_with_missing_snapshot_directory_skips_unmount(
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1070,6 +1075,7 @@ def test_remove_data_source_dumps_with_missing_snapshot_mount_path_skips_unmount
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1135,6 +1141,7 @@ def test_remove_data_source_dumps_with_empty_snapshot_mount_path_skips_unmount()
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1195,6 +1202,7 @@ def test_remove_data_source_dumps_with_successful_mount_point_removal_skips_unmo
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1241,6 +1249,7 @@ def test_remove_data_source_dumps_bails_for_missing_umount_command():
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1293,6 +1302,7 @@ def test_remove_data_source_dumps_swallows_umount_command_error():
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1339,6 +1349,7 @@ def test_remove_data_source_dumps_bails_for_missing_lvs_command():
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1387,6 +1398,7 @@ def test_remove_data_source_dumps_bails_for_lvs_command_error():
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -1430,5 +1442,6 @@ def test_remove_data_source_with_dry_run_skips_snapshot_unmount_and_delete():
hook_config=config['lvm'],
config=config,
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=True,
)
+12
View File
@@ -524,6 +524,7 @@ def test_remove_data_source_dumps_unmounts_and_destroys_snapshots():
hook_config={},
config={'source_directories': '/mnt/dataset', 'zfs': {}},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -556,6 +557,7 @@ def test_remove_data_source_dumps_use_custom_commands():
hook_config=hook_config,
config={'source_directories': '/mnt/dataset', 'zfs': hook_config},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -570,6 +572,7 @@ def test_remove_data_source_dumps_bails_for_missing_hook_configuration():
hook_config=None,
config={'source_directories': '/mnt/dataset'},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -585,6 +588,7 @@ def test_remove_data_source_dumps_bails_for_missing_zfs_command():
hook_config=hook_config,
config={'source_directories': '/mnt/dataset', 'zfs': hook_config},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -602,6 +606,7 @@ def test_remove_data_source_dumps_bails_for_zfs_command_error():
hook_config=hook_config,
config={'source_directories': '/mnt/dataset', 'zfs': hook_config},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -629,6 +634,7 @@ def test_remove_data_source_dumps_bails_for_missing_umount_command():
hook_config=hook_config,
config={'source_directories': '/mnt/dataset', 'zfs': hook_config},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -661,6 +667,7 @@ def test_remove_data_source_dumps_swallows_umount_command_error():
hook_config=hook_config,
config={'source_directories': '/mnt/dataset', 'zfs': hook_config},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -688,6 +695,7 @@ def test_remove_data_source_dumps_skips_unmount_snapshot_directories_that_are_no
hook_config={},
config={'source_directories': '/mnt/dataset', 'zfs': {}},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -721,6 +729,7 @@ def test_remove_data_source_dumps_skips_unmount_snapshot_mount_paths_that_are_no
hook_config={},
config={'source_directories': '/mnt/dataset', 'zfs': {}},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -756,6 +765,7 @@ def test_remove_data_source_dumps_skips_unmount_snapshot_mount_paths_that_are_em
hook_config={},
config={'source_directories': '/mnt/dataset', 'zfs': {}},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -789,6 +799,7 @@ def test_remove_data_source_dumps_skips_unmount_snapshot_mount_paths_after_rmtre
hook_config={},
config={'source_directories': '/mnt/dataset', 'zfs': {}},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=False,
)
@@ -814,5 +825,6 @@ def test_remove_data_source_dumps_with_dry_run_skips_unmount_and_destroy():
hook_config={},
config={'source_directories': '/mnt/dataset', 'zfs': {}},
borgmatic_runtime_directory='/run/borgmatic',
patterns=flexmock(),
dry_run=True,
)