feat: push deletion
This commit is contained in:
@@ -104,6 +104,14 @@ impl ClientTest {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn remove_dir(&mut self, name: &str) -> std::io::Result<()> {
|
||||
let mut path = self.volume.clone();
|
||||
path.push_str("/");
|
||||
path.push_str(name);
|
||||
fs::remove_dir_all(path)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn has_file(&mut self, file: &str, content: &str) -> bool {
|
||||
let full_path = PathBuf::from(self.volume.clone()).join(file);
|
||||
|
||||
|
||||
@@ -36,3 +36,15 @@ pub fn has_not_file(full_path: PathBuf, file: &str, test_id: String) -> bool
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn has_not_dir(full_path: PathBuf, dir: &str, test_id: String) -> bool
|
||||
{
|
||||
if full_path.exists() {
|
||||
println!("id: {}", test_id.clone());
|
||||
eprintln!("Dir '{}' exists but it shouldn't", dir);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -113,5 +113,11 @@ impl ServerTest {
|
||||
let full_path = self.volume.clone().join(file);
|
||||
files_utils::has_not_file(full_path, file, self.test_id.clone())
|
||||
}
|
||||
|
||||
pub fn has_not_dir(&mut self, dir: &str) -> bool {
|
||||
let full_path = self.volume.clone().join(dir);
|
||||
dbg!(full_path.clone());
|
||||
files_utils::has_not_file(full_path, dir, self.test_id.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user