This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user