Commit Graph

9 Commits

Author SHA1 Message Date
Taylor Blau
ee9701171c api/http_lifecycle: add a note about handling HTTP errors 2016-06-03 09:22:19 -06:00
Taylor Blau
44ac3a9b3a api{client,lifecycle}: use config.Endpoint to resolve root 2016-05-25 13:31:12 -06:00
Taylor Blau
b5cfb3efc8 api/http_lifecycle: use httputil.DoHttpRequestWithRedirects() 2016-05-24 09:27:18 -06:00
Taylor Blau
f6a01371a9 api/http_lifecycle: use httputil's client, update tests 2016-05-24 09:27:18 -06:00
Taylor Blau
c7f2cd0211 api/http_lifecycle: make internal methods, add an ASK for @sinbad 2016-05-24 09:27:17 -06:00
Taylor Blau
c282983235 api/schema: initial take on MethodTestCase
The initial thought here is to introduce a MethodTestCase type that
encapsulates the behavior of testing a single method in a particular given
service.

To do so, a httptest.Server is created and the schema is turned into a request
which is fired at that server. Thet MethodTestCase, of course, knows how to
respond to different requests, and the behavior of those responses is tested.

What I dislike is that we have to write three things which are mostly the same
to test any endpoint in any case on the API:
  1) a request type (Go struct)
  2) an expected response type (Go type)
  3) the actual response (a mutltline Go string, which is really just JSON)

This seems redundant, so I may explore other options for implementing this sort
of thing in the future.
2016-05-24 09:27:15 -06:00
Taylor Blau
9234838551 api/http_lifecycle: test HttpLifecycle implementation 2016-05-24 09:27:15 -06:00
Taylor Blau
ff2a96b09d api/response: HttpResponse tests 2016-05-24 09:27:15 -06:00
Taylor Blau
91c1b2d360 api: introduce client, lifecycle and response types
- rename client to v1, v2_client to client
2016-05-24 09:27:14 -06:00