pinakes-server: add utoipa annotations to all routes; fix tests
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I28cf5b7b7cff8e90e123d624d97cf9656a6a6964
This commit is contained in:
parent
67b8322705
commit
9d58927cb4
60 changed files with 3493 additions and 242 deletions
|
|
@ -32,10 +32,7 @@ async fn get_book_metadata_not_found() {
|
|||
.oneshot(get(&format!("/api/v1/books/{fake_id}/metadata")))
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(
|
||||
resp.status() == StatusCode::NOT_FOUND
|
||||
|| resp.status() == StatusCode::INTERNAL_SERVER_ERROR
|
||||
);
|
||||
assert_eq!(resp.status(), StatusCode::NOT_FOUND);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
|
@ -77,10 +74,8 @@ async fn reading_progress_nonexistent_book() {
|
|||
))
|
||||
.await
|
||||
.unwrap();
|
||||
// Nonexistent book; expect NOT_FOUND or empty response
|
||||
assert!(
|
||||
resp.status() == StatusCode::NOT_FOUND || resp.status() == StatusCode::OK
|
||||
);
|
||||
// Nonexistent book always returns 404.
|
||||
assert_eq!(resp.status(), StatusCode::NOT_FOUND);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
|
@ -96,11 +91,8 @@ async fn update_reading_progress_nonexistent_book() {
|
|||
))
|
||||
.await
|
||||
.unwrap();
|
||||
// Nonexistent book; expect NOT_FOUND or error
|
||||
assert!(
|
||||
resp.status() == StatusCode::NOT_FOUND
|
||||
|| resp.status() == StatusCode::INTERNAL_SERVER_ERROR
|
||||
);
|
||||
// Nonexistent book: handler verifies existence first, so always 404.
|
||||
assert_eq!(resp.status(), StatusCode::NOT_FOUND);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue