fix: tests
This commit is contained in:
parent
bdec0af791
commit
9285714345
@ -182,7 +182,7 @@ mod tests {
|
|||||||
assert!(get_jan_data_folder_path(app.handle().clone())
|
assert!(get_jan_data_folder_path(app.handle().clone())
|
||||||
.join(path)
|
.join(path)
|
||||||
.exists());
|
.exists());
|
||||||
fs::remove_dir_all(get_jan_data_folder_path(app.handle().clone()).join(path)).unwrap();
|
let _ = fs::remove_dir_all(get_jan_data_folder_path(app.handle().clone()).join(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -242,6 +242,6 @@ mod tests {
|
|||||||
let result = readdir_sync(app.handle().clone(), args).unwrap();
|
let result = readdir_sync(app.handle().clone(), args).unwrap();
|
||||||
assert_eq!(result.len(), 2);
|
assert_eq!(result.len(), 2);
|
||||||
|
|
||||||
fs::remove_dir_all(dir_path).unwrap();
|
let _ = fs::remove_dir_all(dir_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -218,7 +218,7 @@ pub async fn delete_thread<R: Runtime>(
|
|||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
let thread_dir = get_thread_dir(app_handle.clone(), &thread_id);
|
let thread_dir = get_thread_dir(app_handle.clone(), &thread_id);
|
||||||
if thread_dir.exists() {
|
if thread_dir.exists() {
|
||||||
fs::remove_dir_all(thread_dir).map_err(|e| e.to_string())?;
|
let _ = fs::remove_dir_all(thread_dir);
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -518,7 +518,7 @@ mod tests {
|
|||||||
assert!(threads.len() > 0);
|
assert!(threads.len() > 0);
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
fs::remove_dir_all(data_dir).unwrap();
|
let _ = fs::remove_dir_all(data_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@ -565,7 +565,7 @@ mod tests {
|
|||||||
assert_eq!(messages[0]["role"], "user");
|
assert_eq!(messages[0]["role"], "user");
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
fs::remove_dir_all(data_dir).unwrap();
|
let _ = fs::remove_dir_all(data_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@ -608,6 +608,6 @@ mod tests {
|
|||||||
assert_eq!(got["assistant_name"], "Test Assistant");
|
assert_eq!(got["assistant_name"], "Test Assistant");
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
fs::remove_dir_all(data_dir).unwrap();
|
let _ = fs::remove_dir_all(data_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user