Update to Actix 4
Some checks failed
Core Repos/ImageApi/pipeline/pr-master There was a failure building this commit

This commit is contained in:
Cameron Cordes
2022-03-01 20:38:41 -05:00
parent 1e3f33c2d3
commit 69fe307516
8 changed files with 709 additions and 1074 deletions

View File

@@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};
use ::anyhow;
use anyhow::{anyhow, Context};
use actix_web::web::{HttpResponse, Query};
use actix_web::{web::Query, HttpResponse};
use log::{debug, error};
@@ -133,6 +133,7 @@ mod tests {
use std::fs::File;
use super::*;
use crate::testhelpers::TypedBodyReader;
mod api {
use actix_web::{web::Query, HttpResponse};
@@ -140,7 +141,7 @@ mod tests {
use super::list_photos;
use crate::{
data::{Claims, PhotosResponse, ThumbnailRequest},
testhelpers::TypedBodyReader,
testhelpers::{BodyReader, TypedBodyReader},
};
use std::fs;
@@ -172,10 +173,11 @@ mod tests {
fs::File::create(temp_photo).unwrap();
let response: HttpResponse = list_photos(claims, request).await;
let status = response.status();
let body: PhotosResponse = response.body().read_body();
let body: PhotosResponse = serde_json::from_str(&response.read_to_str()).unwrap();
assert_eq!(response.status(), 200);
assert_eq!(status, 200);
assert!(body.photos.contains(&String::from("photo.jpg")));
assert!(body.dirs.contains(&String::from("test-dir")));
assert!(body