Skip to content

Commit ceabbbf

Browse files
committed
fix: test create local data directory
Since the method crate::disk::get_gupax_data_path() method doesn't create directories, because there is a case where we want to know the path without creating it (for the migration from gupaxx), this test need to be updated to create the directory
1 parent c292c3b commit ceabbbf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/disk/tests.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//---------------------------------------------------------------------------------------------------- TESTS
22
#[cfg(test)]
33
mod test {
4+
use crate::disk::consts::GUPAX_P2POOL_API_DIRECTORY;
5+
use crate::disk::create_gupax_dir;
46
use crate::disk::node::Node;
57
use crate::disk::pool::Pool;
68
use crate::disk::state::State;
@@ -349,6 +351,10 @@ mod test {
349351
// Get API dir, fill paths.
350352
let mut api = GupaxP2poolApi::new();
351353
let mut path = crate::disk::get_gupax_data_path().unwrap();
354+
create_gupax_dir(&path).unwrap();
355+
let mut gupax_p2pool_dir = path.to_path_buf();
356+
gupax_p2pool_dir.push(GUPAX_P2POOL_API_DIRECTORY);
357+
crate::disk::create_gupax_p2pool_dir(&gupax_p2pool_dir).unwrap();
352358
path.push(crate::disk::GUPAX_P2POOL_API_DIRECTORY);
353359
GupaxP2poolApi::fill_paths(&mut api, &path);
354360
println!("{:#?}", api);

0 commit comments

Comments
 (0)