Skip to content

Commit

Permalink
Add testGenerateContent_failure_nonHTTPResponse assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewheard committed Nov 5, 2024
1 parent e44bdba commit 6d1f52f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions FirebaseVertexAI/Tests/Unit/GenerativeModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,9 @@ final class GenerativeModelTests: XCTestCase {
return
}
XCTAssertEqual(underlyingError.localizedDescription, "Response was not an HTTP response.")
let underlyingNSError = underlyingError as NSError
XCTAssertEqual(underlyingNSError.domain, NSURLErrorDomain)
XCTAssertEqual(underlyingNSError.code, URLError.Code.badServerResponse.rawValue)
}

func testGenerateContent_failure_invalidResponse() async throws {
Expand Down

0 comments on commit 6d1f52f

Please sign in to comment.