Skip to content

Commit 729edba

Browse files
committed
cleanup
1 parent ada7b65 commit 729edba

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

FirebaseAI/Tests/Unit/TestUtilities/GenerativeModelTestUtil.swift

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -79,31 +79,6 @@ enum GenerativeModelTestUtil {
7979
#endif // os(watchOS)
8080
}
8181

82-
/// Returns an HTTP request handler that returns the given `json` string as a response.
83-
static func httpRequestHandler(json: String,
84-
statusCode: Int = 200) throws -> ((URLRequest) throws -> (
85-
URLResponse,
86-
Data?
87-
)) {
88-
// Skip tests using MockURLProtocol on watchOS; unsupported in watchOS 2 and later, see
89-
// https://developer.apple.com/documentation/foundation/urlprotocol for details.
90-
#if os(watchOS)
91-
throw XCTSkip("Custom URL protocols are unsupported in watchOS 2 and later.")
92-
#else // os(watchOS)
93-
let data = try XCTUnwrap(json.data(using: .utf8))
94-
return { request in
95-
let requestURL = try XCTUnwrap(request.url)
96-
let response = try XCTUnwrap(HTTPURLResponse(
97-
url: requestURL,
98-
statusCode: statusCode,
99-
httpVersion: nil,
100-
headerFields: nil
101-
))
102-
return (response, data)
103-
}
104-
#endif // os(watchOS)
105-
}
106-
10782
static func nonHTTPRequestHandler() throws -> ((URLRequest) -> (
10883
URLResponse,
10984
AsyncLineSequence<URL.AsyncBytes>?

0 commit comments

Comments
 (0)