mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-26 13:31:02 +00:00
Don't make medias::tests::clean() panic when file not found
This commit is contained in:
parent
e1a598a459
commit
7d320e57da
1 changed files with 9 additions and 1 deletions
|
@ -400,7 +400,15 @@ pub(crate) mod tests {
|
||||||
pub(crate) fn clean(conn: &Conn) {
|
pub(crate) fn clean(conn: &Conn) {
|
||||||
//used to remove files generated by tests
|
//used to remove files generated by tests
|
||||||
for media in Media::list_all_medias(conn).unwrap() {
|
for media in Media::list_all_medias(conn).unwrap() {
|
||||||
media.delete(conn).unwrap();
|
if let Some(err) = media.delete(conn).err() {
|
||||||
|
match &err {
|
||||||
|
Error::Io(e) => match e.kind() {
|
||||||
|
std::io::ErrorKind::NotFound => (),
|
||||||
|
_ => panic!("{:?}", err),
|
||||||
|
},
|
||||||
|
_ => panic!("{:?}", err),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue