diqiu50 commented on code in PR #6013:
URL: https://github.com/apache/gravitino/pull/6013#discussion_r1900489402
##########
clients/filesystem-fuse/src/filesystem.rs:
##########
@@ -290,56 +293,47 @@ pub trait FileWriter: Sync + Send {
pub(crate) mod tests {
use super::*;
use std::collections::HashMap;
+ use std::path::Component;
pub(crate) struct TestPathFileSystem<F: PathFileSystem> {
files: HashMap<PathBuf, FileStat>,
fs: F,
+ cwd: PathBuf,
}
impl<F: PathFileSystem> TestPathFileSystem<F> {
- pub(crate) fn new(fs: F) -> Self {
+ pub(crate) fn new(cwd: &Path, fs: F) -> Self {
Self {
files: HashMap::new(),
fs,
+ cwd: cwd.into(),
}
}
pub(crate) async fn test_path_file_system(&mut self) {
- // Test root dir
- self.test_root_dir().await;
+ // test root dir
+ self.test_stat_file(Path::new("/"), Directory, 0).await;
- // Test stat file
- self.test_stat_file(Path::new("/.gvfs_meta"), RegularFile, 0)
- .await;
+ // test list root dir
+ self.test_list_dir(Path::new("/")).await;
// Test create file
- self.test_create_file(Path::new("/file1.txt")).await;
+ self.test_create_file(&self.cwd.join("file1.txt")).await;
// Test create dir
- self.test_create_dir(Path::new("/dir1")).await;
+ self.test_create_dir(&self.cwd.join("dir1")).await;
// Test list dir
- self.test_list_dir(Path::new("/")).await;
+ self.test_list_dir(&self.cwd).await;
// Test remove file
- self.test_remove_file(Path::new("/file1.txt")).await;
+ self.test_remove_file(&self.cwd.join("file1.txt")).await;
// Test remove dir
- self.test_remove_dir(Path::new("/dir1")).await;
+ self.test_remove_dir(&self.cwd.join("dir1")).await;
// Test file not found
- self.test_file_not_found(Path::new("unknown")).await;
Review Comment:
Test test_root is replace by test_stat_file with "/"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]