test: fix context ensure_available test
This commit is contained in:
@@ -32,8 +32,13 @@ mod tests {
|
||||
let ctx = Context::new(ContextConfig::Local);
|
||||
let dest = ctx.ensure_available(&src_file, "/tmp").unwrap();
|
||||
|
||||
// Should return canonical path
|
||||
assert_eq!(dest, src_file.canonicalize().unwrap());
|
||||
// Should return a path that exists and has the same content
|
||||
assert!(dest.exists());
|
||||
let content = fs::read_to_string(&dest).unwrap();
|
||||
assert_eq!(content, "local");
|
||||
|
||||
// The dest should be in the /tmp directory
|
||||
assert!(dest.starts_with("/tmp"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -106,7 +111,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_context_file_ops() {
|
||||
let temp_dir = tempfile::tempdir().unwrap();
|
||||
let ctx = super::manager().current();
|
||||
let ctx = Context::new(ContextConfig::Local);
|
||||
|
||||
let file_path = temp_dir.path().join("test.txt");
|
||||
let content = "hello world";
|
||||
|
||||
Reference in New Issue
Block a user