Skip to content

Commit ab40e5f

Browse files
committed
delete URLSessionProtocol.downloadTask
1 parent 141b72c commit ab40e5f

File tree

6 files changed

+0
-25
lines changed

6 files changed

+0
-25
lines changed

Sources/EZNetworking/Other/URLSessionProtocol.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ public protocol URLSessionProtocol {
44
func data(for request: URLRequest) async throws -> (Data, URLResponse)
55

66
func download(from url: URL, delegate: URLSessionTaskDelegate?) async throws -> (URL, URLResponse)
7-
func downloadTask(with url: URL, completionHandler: @escaping @Sendable (URL?, URLResponse?, Error?) -> Void) -> URLSessionDownloadTask
87

98
func uploadTask(with request: URLRequest, from bodyData: Data?, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionUploadTask
109

Tests/EZNetworkingTests/Util/Downloader/Mocks/MockFileDownloaderURLSession.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ class MockFileDownloaderURLSession: URLSessionProtocol {
2828
simulateDownloadProgress(for: .init())
2929
return (URL(fileURLWithPath: "/tmp/test.pdf"), urlResponse)
3030
}
31-
32-
func downloadTask(with url: URL, completionHandler: @escaping @Sendable (URL?, URLResponse?, Error?) -> Void) -> URLSessionDownloadTask {
33-
simulateDownloadProgress(for: .init())
34-
35-
return MockURLSessionDownloadTask {
36-
completionHandler(URL(fileURLWithPath: "/tmp/test.pdf"), self.urlResponse, self.error)
37-
}
38-
}
3931
}
4032

4133
// MARK: Helpers

Tests/EZNetworkingTests/Util/Performers/Mocks/MockRequestPerformerURLSession.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ extension MockRequestPerformerURLSession {
3232
fatalError("Should not be using in this mock")
3333
}
3434

35-
func downloadTask(with url: URL, completionHandler: @escaping @Sendable (URL?, URLResponse?, Error?) -> Void) -> URLSessionDownloadTask {
36-
fatalError("Should not be using in this mock")
37-
}
38-
3935
func uploadTask(with request: URLRequest, from bodyData: Data?, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionUploadTask {
4036
fatalError("Should not be using in this mock")
4137
}

Tests/EZNetworkingTests/Util/Uploader/DataUploader/Mocks/MockDataUploaderURLSession.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ extension MockDataUploaderURLSession {
7777
fatalError("Should not be using in this mock")
7878
}
7979

80-
func downloadTask(with url: URL, completionHandler: @escaping @Sendable (URL?, URLResponse?, (any Error)?) -> Void) -> URLSessionDownloadTask {
81-
fatalError("Should not be using in this mock")
82-
}
83-
8480
func uploadTask(with request: URLRequest, fromFile fileURL: URL, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionUploadTask {
8581
fatalError("Should not be using in this mock")
8682
}

Tests/EZNetworkingTests/Util/Uploader/FileUploader/Mocks/MockFileUploaderURLSession.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ extension MockFileUploaderURLSession {
7777
fatalError("Should not be using in this mock")
7878
}
7979

80-
func downloadTask(with url: URL, completionHandler: @escaping @Sendable (URL?, URLResponse?, (any Error)?) -> Void) -> URLSessionDownloadTask {
81-
fatalError("Should not be using in this mock")
82-
}
83-
8480
func uploadTask(with request: URLRequest, from bodyData: Data?, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionUploadTask {
8581
fatalError("Should not be using in this mock")
8682
}

Tests/EZNetworkingTests/Util/WebSocket/Mocks/MockWebSockerURLSession.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ extension MockWebSockerURLSession {
2727
fatalError("Should not be using in this mock")
2828
}
2929

30-
func downloadTask(with url: URL, completionHandler: @escaping @Sendable (URL?, URLResponse?, Error?) -> Void) -> URLSessionDownloadTask {
31-
fatalError("Should not be using in this mock")
32-
}
33-
3430
func uploadTask(with request: URLRequest, from bodyData: Data?, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionUploadTask {
3531
fatalError("Should not be using in this mock")
3632
}

0 commit comments

Comments
 (0)