add test_util stubs for file open and append_line

This commit is contained in:
Paul Campbell 2023-07-30 15:30:09 +01:00
parent fede0eebf1
commit d5b54a75d3

View file

@ -8,6 +8,7 @@ use tempfile::{tempdir, TempDir};
use crate::{ use crate::{
errors::Error, errors::Error,
file::{FileAppendLineFn, FileOpenFn},
network::{NetworkDownloadAsMp3Fn, NetworkFetchAsBytesFn, NetworkFetchAsTextFn}, network::{NetworkDownloadAsMp3Fn, NetworkFetchAsBytesFn, NetworkFetchAsTextFn},
prelude::*, prelude::*,
}; };
@ -45,3 +46,9 @@ pub fn stub_fetch_as_bytes() -> NetworkFetchAsBytesFn {
pub fn stub_download_as_mp3() -> NetworkDownloadAsMp3Fn { pub fn stub_download_as_mp3() -> NetworkDownloadAsMp3Fn {
Box::new(|_url: &str| Err(Error::message("Not implemented"))) Box::new(|_url: &str| Err(Error::message("Not implemented")))
} }
pub fn stub_file_open() -> FileOpenFn {
Box::new(|_path: &str| Err(Error::message("Not implemented")))
}
pub fn stub_file_append_line() -> FileAppendLineFn {
Box::new(|_: &str, _: &str| Err(Error::message("Not implemented")))
}