FAQ
Did you ever figure this out? I'm struggling with the same problem. Even
the long/ugly version.
On Thursday, 3 May 2012 14:34:36 UTC+2, André Moraes wrote:

Is there any library which provide some functions on top of the "testing"
and "net/http/httptest" packages to facilitate the testing of http.Handlers?

Things like Header checking, StatusCode checking, automatic Json
Unmarshaling of the response body.

The current library gives enough flexiblity but for some simple tests the
code becomes quite large.

Thanks in advance
--

Search Discussions

  • Volker Dobler at Nov 12, 2012 at 10:08 am
    I once made something to facilitate end-to-end-testing: webtest [1].
    It is currently not maintained but should build against r60 or so.
    It is not a library but a standalone program which executes
    test suites in a DSL. See the reference [2] what is possible in them.
    Adding Json might be possible, I already thought a bit about
    the test syntax.

    It is unmaintained as nobody seems to like this type of tests:
    They do not capture browser behavior like selenium but are
    more complex to run than simple unit test. And it is not Java.

    Regards, Volker

    [1] https://github.com/vdobler/webtest
    [2] https://github.com/vdobler/webtest/blob/master/reference-suite.wt.pdf?raw=true

    Am Donnerstag, 3. Mai 2012 14:34:36 UTC+2 schrieb André Moraes:
    Is there any library which provide some functions on top of the "testing"
    and "net/http/httptest" packages to facilitate the testing of http.Handlers?

    Things like Header checking, StatusCode checking, automatic Json
    Unmarshaling of the response body.

    The current library gives enough flexiblity but for some simple tests the
    code becomes quite large.

    Thanks in advance
    --
  • Harmaarts at Nov 16, 2012 at 12:13 pm
    Many thanks!
    Last week I had the good fortune to be able to attend a talk by Andrew, in
    it he addressed more of less this issue! His slides are available
    here: http://talks.golang.org/2012/simple.slide#28

    Regards,
    On Monday, 12 November 2012 11:08:29 UTC+1, Volker Dobler wrote:

    I once made something to facilitate end-to-end-testing: webtest [1].
    It is currently not maintained but should build against r60 or so.
    It is not a library but a standalone program which executes
    test suites in a DSL. See the reference [2] what is possible in them.
    Adding Json might be possible, I already thought a bit about
    the test syntax.

    It is unmaintained as nobody seems to like this type of tests:
    They do not capture browser behavior like selenium but are
    more complex to run than simple unit test. And it is not Java.

    Regards, Volker

    [1] https://github.com/vdobler/webtest
    [2]
    https://github.com/vdobler/webtest/blob/master/reference-suite.wt.pdf?raw=true

    Am Donnerstag, 3. Mai 2012 14:34:36 UTC+2 schrieb André Moraes:
    Is there any library which provide some functions on top of the "testing"
    and "net/http/httptest" packages to facilitate the testing of http.Handlers?

    Things like Header checking, StatusCode checking, automatic Json
    Unmarshaling of the response body.

    The current library gives enough flexiblity but for some simple tests the
    code becomes quite large.

    Thanks in advance
    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 11, '12 at 9:57p
activeNov 16, '12 at 12:13p
posts3
users2
websitegolang.org

2 users in discussion

Harmaarts: 2 posts Volker Dobler: 1 post

People

Translate

site design / logo © 2022 Grokbase