From 06e27ddee1d090086c4b2b01cbbfec928a9264bc Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 27 Feb 2023 00:32:47 +0300 Subject: tempfile -> tempdir, remove mockito --- kittybox-rs/src/database/mod.rs | 2 +- kittybox-rs/src/media/storage/file.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'kittybox-rs/src') diff --git a/kittybox-rs/src/database/mod.rs b/kittybox-rs/src/database/mod.rs index 9072d9d..24cff38 100644 --- a/kittybox-rs/src/database/mod.rs +++ b/kittybox-rs/src/database/mod.rs @@ -546,7 +546,7 @@ mod tests { #[tokio::test] #[tracing_test::traced_test] async fn $func_name() { - let tempdir = tempdir::TempDir::new("file").expect("Failed to create tempdir"); + let tempdir = tempfile::tempdir().expect("Failed to create tempdir"); let backend = super::super::FileStorage::new( tempdir.path().to_path_buf() ) diff --git a/kittybox-rs/src/media/storage/file.rs b/kittybox-rs/src/media/storage/file.rs index 6d7068b..cb9cadb 100644 --- a/kittybox-rs/src/media/storage/file.rs +++ b/kittybox-rs/src/media/storage/file.rs @@ -259,7 +259,7 @@ mod tests { #[tokio::test] #[tracing_test::traced_test] async fn test_ranges() { - let tempdir = tempdir::TempDir::new("file").expect("Failed to create tempdir"); + let tempdir = tempfile::tempdir().expect("Failed to create tempdir"); let store = FileStore::new(tempdir.path()); let file: &[u8] = include_bytes!("./file.rs"); @@ -370,7 +370,7 @@ mod tests { #[tokio::test] #[tracing_test::traced_test] async fn test_streaming_read_write() { - let tempdir = tempdir::TempDir::new("file").expect("Failed to create tempdir"); + let tempdir = tempfile::tempdir().expect("Failed to create tempdir"); let store = FileStore::new(tempdir.path()); let file: &[u8] = include_bytes!("./file.rs"); -- cgit 1.4.1