Skip to content

Commit cd63cf7

Browse files
committed
Use XCTUnwrap for constructing test URLs
1 parent 3995b93 commit cd63cf7

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Tests/MuxUploadSDKTests/UploadManagerTests/UploadManagerTests.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ class UploadManagerTests: XCTestCase {
1313

1414
let uploadManager = UploadManager()
1515

16+
let uploadURL = try XCTUnwrap(
17+
URL(string: "https://www.example.com/upload")
18+
)
19+
20+
let videoInputURL = try XCTUnwrap(
21+
URL(string: "file://path/to/dummy/file/")
22+
)
23+
1624
let chunkFileUploader = ChunkedFileUploader(
1725
uploadInfo: UploadInfo(
1826
id: UUID().uuidString,
19-
uploadURL: URL(string: "https://www.example.com/upload")!,
20-
videoFile: URL(string: "file://path/to/dummy/file/")!,
27+
uploadURL: uploadURL,
28+
videoFile: videoInputURL,
2129
chunkSize: 8,
2230
retriesPerChunk: 2,
2331
optOutOfEventTracking: true
@@ -32,8 +40,8 @@ class UploadManagerTests: XCTestCase {
3240
let duplicateChunkFileUploader = ChunkedFileUploader(
3341
uploadInfo: UploadInfo(
3442
id: UUID().uuidString,
35-
uploadURL: URL(string: "https://www.example.com/upload")!,
36-
videoFile: URL(string: "file://path/to/dummy/file/")!,
43+
uploadURL: uploadURL,
44+
videoFile: videoInputURL,
3745
chunkSize: 8,
3846
retriesPerChunk: 2,
3947
optOutOfEventTracking: true

0 commit comments

Comments
 (0)