Changed timeout in GetIsERC1155ContractCoordinatorTestCase to 20 seconds instead of 10 minutes, fixed up some style issues.

pull/4423/head
Jerome Chan 3 years ago
parent bc41e0a45d
commit 89a3423502
  1. 23
      AlphaWalletTests/Tokens/Coordinators/GetIsERC1155ContractCoordinatorTestCase.swift

@ -30,20 +30,23 @@ class GetIsERC1155ContractCoordinatorTestCase: XCTestCase {
func testgetIsERC1155Contract() throws {
let coordinator = GetIsERC1155ContractCoordinator(forServer: .main, cacheName: fileName)
let expectation = expectation(description: "Waiting for server response")
coordinator.getIsERC1155Contract(for: address1)
.done { returnValue in
self.result = returnValue
expectation.fulfill()
}
.cauterize()
wait(for: [expectation], timeout: 10 * 60)
firstly {
coordinator.getIsERC1155Contract(for: address1)
}.done { returnValue in
self.result = returnValue
}.ensure {
expectation.fulfill()
}.catch {error in
XCTFail("Unknown error: \(error)")
}
wait(for: [expectation], timeout: 20)
let cache = CachedERC1155ContractDictionary(fileName: fileName)
XCTAssertNotNil(cache)
XCTAssertNotNil(result)
let cachedResult = cache!.isERC1155Contract(for: address1)
let cachedResult = cache?.isERC1155Contract(for: address1)
XCTAssertNotNil(cachedResult)
XCTAssertEqual(cachedResult!, result!)
cache!.remove()
XCTAssertEqual(cachedResult, result)
cache?.remove()
}
}

Loading…
Cancel
Save