ic-backup 0.64.0

Host-side snapshot backup and same-release recovery for Internet Computer canisters
Documentation
use super::super::*;
use crate::model::artifacts::ArtifactChecksumRecord;
use crate::tests::support::temp_dir;
use std::fs;

#[test]
fn missing_or_non_sibling_paths_reject_without_publication() {
    let root = temp_dir("ic-backup-publication-paths");
    let temporary = root.join("staging");
    let canonical = root.join("snapshot");
    let digest = ArtifactChecksumRecord::from_bytes(b"");
    assert!(matches!(
        commit_artifact_directory(&temporary, &canonical, digest.hash()),
        Err(PersistenceError::ArtifactCommitPathMissing { .. })
    ));
    assert!(matches!(
        commit_artifact_directory(&temporary, &temporary, digest.hash()),
        Err(PersistenceError::ArtifactCommitPathMismatch { .. })
    ));
    assert!(matches!(
        commit_artifact_directory(&temporary, &root.join("other/snapshot"), digest.hash()),
        Err(PersistenceError::ArtifactCommitPathMismatch { .. })
    ));
    fs::remove_dir_all(root).expect("remove successful fixture");
}