File tree Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ class MuxUploadTest: XCTestCase {
4646 }
4747
4848 func testInputInspectionSuccess( ) throws {
49- let input = try UploadInput . mockStartedInput ( )
49+ let input = try UploadInput . mockReadyInput ( )
5050
5151 let upload = MuxUpload (
5252 input: input,
@@ -82,7 +82,7 @@ class MuxUploadTest: XCTestCase {
8282 }
8383
8484 func testInputInspectionFailure( ) throws {
85- let input = try UploadInput . mockStartedInput ( )
85+ let input = try UploadInput . mockReadyInput ( )
8686
8787 let upload = MuxUpload (
8888 input: input,
Original file line number Diff line number Diff line change @@ -10,17 +10,17 @@ import Foundation
1010class MockUploadInputInspector : UploadInputInspector {
1111
1212 static let alwaysStandard : MockUploadInputInspector = MockUploadInputInspector (
13- mockInspectionResult: . standard
13+ mockInspectionResult: . standard( duration : . zero )
1414 )
1515
1616 static let alwaysFailing : MockUploadInputInspector = MockUploadInputInspector (
17- mockInspectionResult: . inspectionFailure
17+ mockInspectionResult: . inspectionFailure( duration : . zero )
1818 )
1919
2020 var mockInspectionResult : UploadInputFormatInspectionResult
2121
2222 init ( ) {
23- self . mockInspectionResult = . standard
23+ self . mockInspectionResult = . standard( duration : . zero )
2424 }
2525
2626 init (
Original file line number Diff line number Diff line change @@ -10,6 +10,30 @@ import XCTest
1010
1111extension UploadInput {
1212
13+ static func mockReadyInput( ) throws -> Self {
14+ let uploadURL = try XCTUnwrap (
15+ URL ( string: " https://www.example.com/upload " )
16+ )
17+
18+ let videoInputURL = try XCTUnwrap (
19+ URL ( string: " file://path/to/dummy/file/ " )
20+ )
21+
22+ let uploadInputAsset = AVAsset (
23+ url: videoInputURL
24+ )
25+
26+ return UploadInput (
27+ status: . ready(
28+ uploadInputAsset,
29+ UploadInfo (
30+ uploadURL: uploadURL,
31+ options: . default
32+ )
33+ )
34+ )
35+ }
36+
1337 static func mockStartedInput( ) throws -> Self {
1438 let uploadURL = try XCTUnwrap (
1539 URL ( string: " https://www.example.com/upload " )
You can’t perform that action at this time.
0 commit comments