This commit is contained in:
@@ -192,8 +192,7 @@ extension MQTTClient.Version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@_spi(Internal)
|
extension Logger.Level {
|
||||||
public extension Logger.Level {
|
|
||||||
|
|
||||||
/// Parse a `Logger.Level` from the loaded `EnvVars`.
|
/// Parse a `Logger.Level` from the loaded `EnvVars`.
|
||||||
static func from(environment envVars: EnvVars) -> Self {
|
static func from(environment envVars: EnvVars) -> Self {
|
||||||
|
|||||||
@@ -115,6 +115,25 @@ final class CliClientTests: XCTestCase {
|
|||||||
let environment = EnvironmentDependency.liveValue
|
let environment = EnvironmentDependency.liveValue
|
||||||
XCTAssertEqual(environment.processInfo(), ProcessInfo.processInfo.environment)
|
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
|
// - MARK: Helper
|
||||||
|
|||||||
Reference in New Issue
Block a user