1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +02:00

update tests to async handlers

This commit is contained in:
Nikolay Kim
2019-11-22 11:49:35 +06:00
parent e668acc596
commit 57981ca04a
9 changed files with 111 additions and 79 deletions

View File

@ -1176,9 +1176,11 @@ mod tests {
let mut srv =
test::init_service(App::new().wrap(Compress::default()).service(
web::resource("/").to(|| {
NamedFile::open("Cargo.toml")
.unwrap()
.set_content_encoding(header::ContentEncoding::Identity)
async {
NamedFile::open("Cargo.toml")
.unwrap()
.set_content_encoding(header::ContentEncoding::Identity)
}
}),
))
.await;
@ -1199,9 +1201,11 @@ mod tests {
let mut srv =
test::init_service(App::new().wrap(Compress::default()).service(
web::resource("/").to(|| {
NamedFile::open("Cargo.toml")
.unwrap()
.set_content_encoding(header::ContentEncoding::Gzip)
async {
NamedFile::open("Cargo.toml")
.unwrap()
.set_content_encoding(header::ContentEncoding::Gzip)
}
}),
))
.await;