podhmo / go-webtest

Sometimes, easy is better than simple
MIT License
1 stars 0 forks source link

With round tripper #40

Closed podhmo closed 5 years ago

podhmo commented 5 years ago
$ DEBUG=1 go test
2019/09/01 19:26:58 builtin DebugRoundTripper is activated
    Request : ------------------------------
    GET /status/200 HTTP/1.1
    Host: 127.0.0.1:44709

    ----------------------------------------
    Response: ------------------------------
    HTTP/1.1 200 OK
    Content-Length: 32
    Content-Type: application/json; charset=utf-8
    Date: Sun, 01 Sep 2019 10:26:58 GMT

    {"status": 200, "message": "OK"}
    ----------------------------------------
    Request : ------------------------------
    GET /status/200 HTTP/1.1
    Host: 127.0.0.1:44709

    ----------------------------------------
    Response: ------------------------------
    HTTP/1.1 200 OK
    Content-Length: 32
    Content-Type: application/json; charset=utf-8
    Date: Sun, 01 Sep 2019 10:26:58 GMT

    {"status": 200, "message": "OK"}
    ----------------------------------------
    Request : ------------------------------
    GET /status/200 HTTP/1.1
    Host: 127.0.0.1:44709

    ----------------------------------------
    Response: ------------------------------
    HTTP/1.1 200 OK
    Content-Length: 32
    Content-Type: application/json; charset=utf-8
    Date: Sun, 01 Sep 2019 10:26:58 GMT

    {"status": 200, "message": "OK"}
    ----------------------------------------
    Request : ------------------------------
    GET /status/201 HTTP/1.1
    Host: 127.0.0.1:44709

    ----------------------------------------
    Response: ------------------------------
    HTTP/1.1 201 Created
    Content-Length: 37
    Content-Type: application/json; charset=utf-8
    Date: Sun, 01 Sep 2019 10:26:58 GMT

    {"status": 201, "message": "Created"}
    ----------------------------------------
    Request : ------------------------------
    GET /status/404 HTTP/1.1
    Host: 127.0.0.1:44709

    ----------------------------------------
    Response: ------------------------------
    HTTP/1.1 404 Not Found
    Content-Length: 39
    Content-Type: application/json; charset=utf-8
    Date: Sun, 01 Sep 2019 10:26:58 GMT

    {"status": 404, "message": "Not Found"}
    ----------------------------------------
    Request : ------------------------------
    GET /status/200 HTTP/1.1
    Host: example.com

    ----------------------------------------
    Response: ------------------------------
    HTTP/1.1 200 OK
    Connection: close
    Content-Type: application/json; charset=utf-8

    {"status": 200, "message": "OK"}
    ----------------------------------------
PASS
ok      github.com/podhmo/go-webtest/httpbin    0.006s