Skip to content

Commit 6d1f52f

Browse files
committed
Add testGenerateContent_failure_nonHTTPResponse assertions
1 parent e44bdba commit 6d1f52f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,9 @@ final class GenerativeModelTests: XCTestCase {
740740
return
741741
}
742742
XCTAssertEqual(underlyingError.localizedDescription, "Response was not an HTTP response.")
743+
let underlyingNSError = underlyingError as NSError
744+
XCTAssertEqual(underlyingNSError.domain, NSURLErrorDomain)
745+
XCTAssertEqual(underlyingNSError.code, URLError.Code.badServerResponse.rawValue)
743746
}
744747

745748
func testGenerateContent_failure_invalidResponse() async throws {

0 commit comments

Comments
 (0)