Skip to content

Commit

Permalink
Merge pull request #20 from IBM-Swift/flaky-test
Browse files Browse the repository at this point in the history
Fix flaky test testSimpleHTTPClient
  • Loading branch information
Pushkar N Kulkarni committed May 28, 2018
2 parents bdae375 + 52df19f commit 42995ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tests/KituraNIOTests/ClientE2ETests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ class ClientE2ETests: KituraNetTest {
}

func testSimpleHTTPClient() {
_ = HTTP.get("http://www.ibm.com") {response in
_ = HTTP.get("http://httpbin.org") {response in
XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
let contentType = response?.headers["Content-Type"]
XCTAssertNotNil(contentType, "No ContentType header in response")
if let contentType = contentType {
XCTAssertEqual(contentType, ["text/html"], "Content-Type header wasn't `text/html`")
XCTAssertEqual(contentType, ["text/html; charset=utf-8"], "Content-Type header wasn't `text/html`")
}
}
}
Expand Down

0 comments on commit 42995ea

Please sign in to comment.