Skip to content

Commit 1a1bd2d

Browse files
committed
Adhere to Swift formatting guidelines, remove snake casing (#37)
1 parent d61bb53 commit 1a1bd2d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Sources/MuxUploadSDK/Upload/ChunkWorker.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,13 @@ fileprivate class ProgressReportingURLSessionTaskDelegate : NSObject, URLSession
212212
}
213213

214214
class ChunkResponseValidator {
215-
public static let ACCEPTABLE_HTTP_STATUS_CODES = [200, 201, 202, 204, 308]
216-
public static let RETRYABLE_HTTP_STATUS_CODES = [408, 502, 503, 504]
215+
public static let acceptableHTTPStatusCodes = [200, 201, 202, 204, 308]
216+
public static let retryableHTTPStatusCodes = [408, 502, 503, 504]
217217

218218
func validate(statusCode: Int) -> Disposition {
219-
if ChunkResponseValidator.ACCEPTABLE_HTTP_STATUS_CODES.contains(statusCode) {
219+
if ChunkResponseValidator.acceptableHTTPStatusCodes.contains(statusCode) {
220220
return .proceed
221-
} else if ChunkResponseValidator.RETRYABLE_HTTP_STATUS_CODES.contains(statusCode) {
221+
} else if ChunkResponseValidator.retryableHTTPStatusCodes.contains(statusCode) {
222222
return .retry
223223
} else {
224224
return .error

Tests/MuxUploadSDKTests/Upload Tests/ChunkWorkerTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class ChunkWorker: XCTestCase {
1212

1313
func testResponseValidatorRetryCodes() throws {
1414
let validator = ChunkResponseValidator()
15-
for code in ChunkResponseValidator.RETRYABLE_HTTP_STATUS_CODES {
15+
for code in ChunkResponseValidator.retryableHTTPStatusCodes {
1616
switch validator.validate(statusCode: code) {
1717
case .retry: return ()
1818
default: return XCTFail("All Retryable codes should result in retries")
@@ -22,7 +22,7 @@ final class ChunkWorker: XCTestCase {
2222

2323
func testResponseValidatorSuccessCodes() throws {
2424
let validator = ChunkResponseValidator()
25-
for code in ChunkResponseValidator.ACCEPTABLE_HTTP_STATUS_CODES {
25+
for code in ChunkResponseValidator.acceptableHTTPStatusCodes {
2626
switch validator.validate(statusCode: code) {
2727
case .proceed: return ()
2828
default: return XCTFail("All Acceptable codes should result in proceeding")

Tests/MuxUploadSDKTests/Upload Tests/UploadPersistenceTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import XCTest
1010

1111
/// Tests the write-through logic of the Upload Peristence. Actual interaction with the filesystem can't be tested
1212
final class UploadPersistenceTests: XCTestCase {
13-
static let OLD_ENTRY_AGE_SEC: TimeInterval = 30 * 24 * 60 * 60
13+
static let oldEntryAgeInSeconds: TimeInterval = 30 * 24 * 60 * 60
1414

1515
// TESTS
1616
// writesInProgressShouldSave
@@ -149,7 +149,7 @@ final class UploadPersistenceTests: XCTestCase {
149149
uploadInfo: renameDummyUploadInfo(basename: "newer")
150150
)
151151
let olderEntry = PersistenceEntry(
152-
savedAt: UploadPersistenceTests.OLD_ENTRY_AGE_SEC,
152+
savedAt: UploadPersistenceTests.oldEntryAgeInSeconds,
153153
stateCode: .wasPaused,
154154
lastSuccessfulByte: 0,
155155
uploadInfo: renameDummyUploadInfo(basename: "older")

0 commit comments

Comments
 (0)