feat: cli client test updates
Some checks failed
CI / Run Tests (push) Failing after 3h8m1s

This commit is contained in:
2024-11-18 17:16:44 -05:00
parent 24f2ad63a7
commit 756fd0bccf
2 changed files with 20 additions and 2 deletions

View File

@@ -192,8 +192,7 @@ extension MQTTClient.Version {
}
}
@_spi(Internal)
public extension Logger.Level {
extension Logger.Level {
/// Parse a `Logger.Level` from the loaded `EnvVars`.
static func from(environment envVars: EnvVars) -> Self {

View File

@@ -115,6 +115,25 @@ final class CliClientTests: XCTestCase {
let environment = EnvironmentDependency.liveValue
XCTAssertEqual(environment.processInfo(), ProcessInfo.processInfo.environment)
}
func testMakeClient() throws {
@Dependency(\.cliClient) var cliClient
let envVars = EnvVars.test
let client = try cliClient.makeClient(.init(
environment: envVars,
eventLoopGroup: .init(numberOfThreads: 1),
logger: nil
))
XCTAssertEqual(client.host, envVars.host)
XCTAssertEqual(client.port, Int(envVars.port!))
XCTAssertEqual(client.identifier, envVars.identifier)
XCTAssertEqual(client.configuration.version, .v5_0)
XCTAssertEqual(client.configuration.userName, envVars.userName)
XCTAssertEqual(client.configuration.password, envVars.password)
try client.syncShutdownGracefully()
}
}
// - MARK: Helper