mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Update reachability test
This commit is contained in:
@@ -32,14 +32,12 @@ class OpenVPNReachabilityTests: XCTestCase {
|
|||||||
let reachabilityExpectation = expectation(description: "me.ss-abramchuk.openvpn-adapter.reachability")
|
let reachabilityExpectation = expectation(description: "me.ss-abramchuk.openvpn-adapter.reachability")
|
||||||
|
|
||||||
let reachability = OpenVPNReachability()
|
let reachability = OpenVPNReachability()
|
||||||
reachability.reachabilityStatusChangedBlock = { status in
|
reachability.startTracking { (status) in
|
||||||
if case OpenVPNReachabilityStatus.reachableViaWiFi = status {
|
if case OpenVPNReachabilityStatus.reachableViaWiFi = status {
|
||||||
reachabilityExpectation.fulfill()
|
reachabilityExpectation.fulfill()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reachability.startTracking()
|
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now()) {
|
DispatchQueue.main.asyncAfter(deadline: .now()) {
|
||||||
try? interface.setPower(false)
|
try? interface.setPower(false)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user