Skip to content

Commit

Permalink
Fix unit test formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Gayathri Sairamkrishnan committed Dec 19, 2024
1 parent c68e5d4 commit f0a8282
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions Tests/OpenAPIRuntimeTests/Errors/Test_RuntimeError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ struct MockRuntimeErrorHandler: Sendable {
}

final class Test_RuntimeError: XCTestCase {

func testRuntimeError_withUnderlyingErrorNotConfirming_returns500() async throws {

let server = UniversalServer(handler: MockRuntimeErrorHandler(failWithError: RuntimeError.transportFailed(TestError())),
middlewares: [ErrorHandlingMiddleware()])
let server = UniversalServer(
handler: MockRuntimeErrorHandler(failWithError: RuntimeError.transportFailed(TestError())),
middlewares: [ErrorHandlingMiddleware()]
)
let response = try await server.handle(
request: .init(soar_path: "/", method: .post),
requestBody: MockHandler.requestBody,
Expand All @@ -50,9 +50,10 @@ final class Test_RuntimeError: XCTestCase {
}

func testRuntimeError_withUnderlyingErrorConfirming_returnsCorrectStatusCode() async throws {

let server = UniversalServer(handler: MockRuntimeErrorHandler(failWithError: TestErrorConvertible.testError("Test Error")),
middlewares: [ErrorHandlingMiddleware()])
let server = UniversalServer(
handler: MockRuntimeErrorHandler(failWithError: TestErrorConvertible.testError("Test Error")),
middlewares: [ErrorHandlingMiddleware()]
)
let response = try await server.handle(
request: .init(soar_path: "/", method: .post),
requestBody: MockHandler.requestBody,
Expand All @@ -71,11 +72,6 @@ final class Test_RuntimeError: XCTestCase {

enum TestErrorConvertible: Error, HTTPResponseConvertible {
case testError(String)

/// HTTP status code for error cases
public var httpStatus: HTTPTypes.HTTPResponse.Status {
.badGateway
}
public var httpStatus: HTTPTypes.HTTPResponse.Status { .badGateway }
}


0 comments on commit f0a8282

Please sign in to comment.