Skip to content

Commit 0f85898

Browse files
committed
testdiag
1 parent 44f389b commit 0f85898

File tree

1 file changed

+11
-31
lines changed

1 file changed

+11
-31
lines changed

SwiftIpfsApiTests/SwiftIpfsApiTests.swift

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -703,28 +703,23 @@ class SwiftIpfsApiTests: XCTestCase {
703703

704704
func testDiag() {
705705

706-
let net = { (dispatchGroup: DispatchGroup) throws -> Void in
707-
let api = try IpfsApi(host: self.hostString, port: self.hostPort)
708-
try api.diag.net() {
709-
result in
710-
print(result)
711-
/// do comparison with truth here.
712-
dispatchGroup.leave()
713-
}
714-
}
715-
716-
tester(net)
717-
718-
let sys = { (dispatchGroup: DispatchGroup) throws -> Void in
706+
let expectation = XCTestExpectation(description: "testDiagSys")
707+
do {
708+
719709
let api = try IpfsApi(host: self.hostString, port: self.hostPort)
710+
720711
try api.diag.sys() {
721712
result in
722-
print(result)
713+
print("diag sys result: \(result)")
723714
/// do comparison with truth here.
724-
dispatchGroup.leave()
715+
expectation.fulfill()
725716
}
717+
718+
} catch {
719+
XCTFail("testDiag failed with error \(error)")
726720
}
727-
tester(sys)
721+
722+
wait(for: [expectation], timeout: 5.0)
728723
}
729724

730725
func testConfig() {
@@ -766,21 +761,6 @@ class SwiftIpfsApiTests: XCTestCase {
766761
} catch {
767762
XCTFail("testConfig failed with error \(error)")
768763
}
769-
770-
//
771-
//
772-
//
773-
774-
// let api = try IpfsApi(host: self.hostString, port: self.hostPort)
775-
// try api.config.get("Datastore.Type") {
776-
// result in
777-
// /// do comparison with truth here.
778-
// if case .String(let strResult) = result, strResult == "leveldb" { } else {
779-
// XCTFail()
780-
// }
781-
// dispatchGroup.leave()
782-
// }
783-
784764
}
785765

786766

0 commit comments

Comments
 (0)