Skip to content

Commit 0e317fb

Browse files
Merge pull request #97 from theseus-rs/correct-tests
test: correct extract test implementations
2 parents f43280f + 98e6df9 commit 0e317fb

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

postgresql_archive/tests/archive.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use postgresql_archive::configuration::theseus;
22
use postgresql_archive::extract;
33
use postgresql_archive::{get_archive, get_version};
44
use semver::VersionReq;
5-
use std::fs::{create_dir_all, remove_dir_all};
5+
use std::fs::remove_dir_all;
66
use test_log::test;
77

88
#[test(tokio::test)]
@@ -32,7 +32,6 @@ async fn test_get_archive_and_extract() -> anyhow::Result<()> {
3232
assert!(version_req.matches(&archive_version));
3333

3434
let out_dir = tempfile::tempdir()?.path().to_path_buf();
35-
create_dir_all(&out_dir)?;
3635
extract(url, &archive, &out_dir).await?;
3736
remove_dir_all(&out_dir)?;
3837
Ok(())

postgresql_archive/tests/blocking.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use postgresql_archive::configuration::theseus;
55
#[cfg(feature = "blocking")]
66
use postgresql_archive::VersionReq;
77
#[cfg(feature = "blocking")]
8-
use std::fs::{create_dir_all, remove_dir_all};
8+
use std::fs::remove_dir_all;
99
#[cfg(feature = "blocking")]
1010
use test_log::test;
1111

@@ -30,7 +30,6 @@ fn test_get_archive_and_extract() -> anyhow::Result<()> {
3030
assert!(version_req.matches(&archive_version));
3131

3232
let out_dir = tempfile::tempdir()?.path().to_path_buf();
33-
create_dir_all(&out_dir)?;
3433
extract(url, &archive, &out_dir)?;
3534
remove_dir_all(&out_dir)?;
3635
Ok(())

postgresql_archive/tests/zonky.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use postgresql_archive::configuration::zonky;
22
use postgresql_archive::extract;
33
use postgresql_archive::{get_archive, get_version};
44
use semver::VersionReq;
5-
use std::fs::{create_dir_all, remove_dir_all};
5+
use std::fs::remove_dir_all;
66
use test_log::test;
77

88
#[test(tokio::test)]
@@ -32,7 +32,6 @@ async fn test_get_archive_and_extract() -> anyhow::Result<()> {
3232
assert!(version_req.matches(&archive_version));
3333

3434
let out_dir = tempfile::tempdir()?.path().to_path_buf();
35-
create_dir_all(&out_dir)?;
3635
extract(url, &archive, &out_dir).await?;
3736
remove_dir_all(&out_dir)?;
3837
Ok(())

0 commit comments

Comments
 (0)