feat: refine AI retouch workflow
This commit is contained in:
@@ -243,6 +243,7 @@ final class TravelAlbumAPITests: XCTestCase {
|
||||
jobSubmissionJSON(batchId: 51, albumId: 6),
|
||||
jobSubmissionJSON(batchId: 52, albumId: 6),
|
||||
jobSubmissionJSON(batchId: 53, albumId: 6),
|
||||
jobSubmissionJSON(batchId: 54, albumId: 6),
|
||||
])
|
||||
let api = TravelAlbumAPI(client: APIClient(environment: .testing, session: session))
|
||||
|
||||
@@ -273,13 +274,22 @@ final class TravelAlbumAPITests: XCTestCase {
|
||||
atmosphereTemplateId: 22
|
||||
)
|
||||
)
|
||||
try await api.submitAIReretouch(
|
||||
TravelAlbumAIReretouchRequest(
|
||||
id: 14,
|
||||
aiRetouchBatchId: 54,
|
||||
type: .all,
|
||||
refinedTemplateId: 21,
|
||||
atmosphereTemplateId: nil
|
||||
)
|
||||
)
|
||||
|
||||
let bodies = try session.requests.map { request in
|
||||
try JSONSerialization.jsonObject(with: XCTUnwrap(request.httpBody)) as? [String: Any]
|
||||
}
|
||||
XCTAssertEqual(session.requests.map { $0.url?.path }, Array(
|
||||
repeating: "/api/yf-handset-app/photog/travel-album/ai-reretouch",
|
||||
count: 3
|
||||
count: 4
|
||||
))
|
||||
XCTAssertEqual(Set(bodies[0]?.keys.map { $0 } ?? []), ["id", "ai_retouch_batch_id", "type", "refined_template_id"])
|
||||
XCTAssertEqual(Set(bodies[1]?.keys.map { $0 } ?? []), ["id", "ai_retouch_batch_id", "type", "atmosphere_template_id"])
|
||||
@@ -290,9 +300,16 @@ final class TravelAlbumAPITests: XCTestCase {
|
||||
"refined_template_id",
|
||||
"atmosphere_template_id",
|
||||
])
|
||||
XCTAssertEqual(Set(bodies[3]?.keys.map { $0 } ?? []), [
|
||||
"id",
|
||||
"ai_retouch_batch_id",
|
||||
"type",
|
||||
"refined_template_id",
|
||||
])
|
||||
XCTAssertEqual(bodies[0]?["type"] as? Int, 1)
|
||||
XCTAssertEqual(bodies[1]?["type"] as? Int, 2)
|
||||
XCTAssertEqual(bodies[2]?["type"] as? Int, 3)
|
||||
XCTAssertEqual(bodies[3]?["type"] as? Int, 3)
|
||||
}
|
||||
|
||||
func testAIJobListBuildsCursorQueryAndDecodesUnknownStatusSafely() async throws {
|
||||
|
||||
Reference in New Issue
Block a user