Don't make medias::tests::clean() panic when file not found
This commit is contained in:
parent
e1a598a459
commit
7d320e57da
@ -400,7 +400,15 @@ pub(crate) mod tests {
|
||||
pub(crate) fn clean(conn: &Conn) {
|
||||
//used to remove files generated by tests
|
||||
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 New Issue
Block a user