From f318074ac539dec0c222b61fac1acaa6d9a70fb0 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 10 May 2026 01:45:31 -0400 Subject: [PATCH] tests --- .../angle/flux_2_lora_edit_image_angle/api.rs | 2 + .../edit/nano_banana_2_edit_image/api.rs | 53 ++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/crates/api_clients/fal_client/src/requests/api/image/angle/flux_2_lora_edit_image_angle/api.rs b/crates/api_clients/fal_client/src/requests/api/image/angle/flux_2_lora_edit_image_angle/api.rs index 8e08520c36..6ddb7d7127 100644 --- a/crates/api_clients/fal_client/src/requests/api/image/angle/flux_2_lora_edit_image_angle/api.rs +++ b/crates/api_clients/fal_client/src/requests/api/image/angle/flux_2_lora_edit_image_angle/api.rs @@ -151,4 +151,6 @@ mod tests { Ok(()) } + + // NB: Pricing tests are in cost.rs } diff --git a/crates/api_clients/fal_client/src/requests/api/image/edit/nano_banana_2_edit_image/api.rs b/crates/api_clients/fal_client/src/requests/api/image/edit/nano_banana_2_edit_image/api.rs index 7534f58d0f..85c5208ddc 100644 --- a/crates/api_clients/fal_client/src/requests/api/image/edit/nano_banana_2_edit_image/api.rs +++ b/crates/api_clients/fal_client/src/requests/api/image/edit/nano_banana_2_edit_image/api.rs @@ -111,7 +111,10 @@ mod tests { use crate::requests::traits::fal_endpoint_trait::FalEndpoint; use errors::AnyhowResult; use std::fs::read_to_string; - use test_data::web::image_urls::GHOST_IMAGE_URL; + use test_data::web::image_urls::{ + ERNEST_SCARED_STUPID_IMAGE_URL, GHOST_IMAGE_URL, TREX_SKELETON_IMAGE_URL, + WHITE_HOUSE_SUNSET_IMAGE_URL, + }; #[tokio::test] #[ignore] // manually test — requires real API key, incurs costs @@ -133,5 +136,53 @@ mod tests { Ok(()) } + #[tokio::test] + #[ignore] // manually test — requires real API key, incurs costs + async fn test_edit_multi_image_spooky() -> AnyhowResult<()> { + let secret = read_to_string("/Users/bt/Artcraft/credentials/fal_api_key.txt")?; + let api_key = FalApiKey::from_str(&secret); + + let request = NanoBanana2EditImageRequest { + prompt: "add the ghost and scared man to the image of the t-rex skeleton, make it look spooky but friendly".to_string(), + image_urls: vec![ + GHOST_IMAGE_URL.to_string(), + TREX_SKELETON_IMAGE_URL.to_string(), + ERNEST_SCARED_STUPID_IMAGE_URL.to_string(), + ], + num_images: NanoBanana2EditImageNumImages::Two, + resolution: Some(NanoBanana2EditImageResolution::TwoK), + aspect_ratio: Some(NanoBanana2EditImageAspectRatio::SixteenByNine), + }; + + let result = request.send_queue_request(&api_key).await?; + println!("Request ID: {}", result.request_id); + assert!(!result.request_id.is_empty()); + Ok(()) + } + + #[tokio::test] + #[ignore] // manually test — requires real API key, incurs costs + async fn test_edit_multi_image_white_house() -> AnyhowResult<()> { + let secret = read_to_string("/Users/bt/Artcraft/credentials/fal_api_key.txt")?; + let api_key = FalApiKey::from_str(&secret); + + let request = NanoBanana2EditImageRequest { + prompt: "Put the scared man and the t-rex in front of the white house scene. Make the man afraid of the t-rex.".to_string(), + image_urls: vec![ + WHITE_HOUSE_SUNSET_IMAGE_URL.to_string(), + TREX_SKELETON_IMAGE_URL.to_string(), + ERNEST_SCARED_STUPID_IMAGE_URL.to_string(), + ], + num_images: NanoBanana2EditImageNumImages::Two, + resolution: Some(NanoBanana2EditImageResolution::TwoK), + aspect_ratio: Some(NanoBanana2EditImageAspectRatio::SixteenByNine), + }; + + let result = request.send_queue_request(&api_key).await?; + println!("Request ID: {}", result.request_id); + assert!(!result.request_id.is_empty()); + Ok(()) + } + // NB: Pricing tests are in cost.rs }