use std::{
fs::File,
io::{self, Write},
};
use isobemak::create_disk_and_iso;
use tempfile::{NamedTempFile, tempdir};
#[test]
fn test_create_disk_and_iso() -> io::Result<()> {
let temp_dir = tempdir()?;
let iso_path = temp_dir.path().join("test.iso");
let fat_img_path = temp_dir.path().join("test.img");
let bellows_path = temp_dir.path().join("bellows.efi");
let kernel_path = temp_dir.path().join("kernel.efi");
File::create(&bellows_path)?.write_all(b"this is a mock bellows file")?;
File::create(&kernel_path)?.write_all(b"this is a mock kernel file")?;
let created_fat_img_path =
create_disk_and_iso(&iso_path, &bellows_path, &kernel_path, &fat_img_path)?;
assert!(created_fat_img_path.exists());
assert!(iso_path.exists());
Ok(())
}