File tree Expand file tree Collapse file tree 1 file changed +0
-25
lines changed
FirebaseAI/Tests/Unit/TestUtilities Expand file tree Collapse file tree 1 file changed +0
-25
lines changed Original file line number Diff line number Diff line change @@ -79,31 +79,6 @@ enum GenerativeModelTestUtil {
79
79
#endif // os(watchOS)
80
80
}
81
81
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
-
107
82
static func nonHTTPRequestHandler( ) throws -> ( ( URLRequest ) -> (
108
83
URLResponse ,
109
84
AsyncLineSequence < URL . AsyncBytes > ?
You can’t perform that action at this time.
0 commit comments