Skip to content

Commit 556701e

Browse files
author
David Motsonashvili
committed
add test
1 parent b724185 commit 556701e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

firebase-ai/src/test/java/com/google/firebase/ai/VertexAIUnarySnapshotTests.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,18 @@ internal class VertexAIUnarySnapshotTests {
591591
}
592592
}
593593

594+
@Test
595+
fun `generateImages should contain safety data`() =
596+
goldenVertexUnaryFile("unary-success-generate-images-safety_info.json") {
597+
withTimeout(testTimeout) {
598+
val response = imagenModel.generateImages("prompt")
599+
response.images[0].safetyAttributes shouldNotBe emptyMap<String, Double>()
600+
response.images[1].safetyAttributes shouldNotBe emptyMap<String, Double>()
601+
response.images[2].safetyAttributes shouldNotBe emptyMap<String, Double>()
602+
response.images[3].safetyAttributes shouldBe emptyMap<String, Double>()
603+
}
604+
}
605+
594606
@Test
595607
fun `google search grounding metadata is parsed correctly`() =
596608
goldenVertexUnaryFile("unary-success-google-search-grounding.json") {

0 commit comments

Comments
 (0)