mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Fixed host tests
This commit is contained in:
@@ -641,11 +641,11 @@ mod tests {
|
|||||||
let mut host: Localhost = Localhost::new(PathBuf::from(tmpdir.path())).ok().unwrap();
|
let mut host: Localhost = Localhost::new(PathBuf::from(tmpdir.path())).ok().unwrap();
|
||||||
let files: Vec<FsEntry> = host.list_dir();
|
let files: Vec<FsEntry> = host.list_dir();
|
||||||
assert_eq!(files.len(), 0); // There should be 0 files now
|
assert_eq!(files.len(), 0); // There should be 0 files now
|
||||||
assert!(host.mkdir(String::from("test_dir")).is_ok());
|
assert!(host.mkdir(PathBuf::from("test_dir").as_path()).is_ok());
|
||||||
let files: Vec<FsEntry> = host.list_dir();
|
let files: Vec<FsEntry> = host.list_dir();
|
||||||
assert_eq!(files.len(), 1); // There should be 1 file now
|
assert_eq!(files.len(), 1); // There should be 1 file now
|
||||||
// Try to re-create directory
|
// Try to re-create directory
|
||||||
assert!(host.mkdir(String::from("test_dir")).is_err())
|
assert!(host.mkdir(PathBuf::from("test_dir").as_path()).is_err())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -663,7 +663,7 @@ mod tests {
|
|||||||
let files: Vec<FsEntry> = host.list_dir();
|
let files: Vec<FsEntry> = host.list_dir();
|
||||||
assert_eq!(files.len(), 0); // There should be 0 files now
|
assert_eq!(files.len(), 0); // There should be 0 files now
|
||||||
// Create directory
|
// Create directory
|
||||||
assert!(host.mkdir(String::from("test_dir")).is_ok());
|
assert!(host.mkdir(PathBuf::from("test_dir").as_path()).is_ok());
|
||||||
// Delete directory
|
// Delete directory
|
||||||
let files: Vec<FsEntry> = host.list_dir();
|
let files: Vec<FsEntry> = host.list_dir();
|
||||||
assert_eq!(files.len(), 1); // There should be 1 file now
|
assert_eq!(files.len(), 1); // There should be 1 file now
|
||||||
|
|||||||
Reference in New Issue
Block a user