c282983235
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. |
||
---|---|---|
.. | ||
command_checkout.go | ||
command_clean.go | ||
command_clone.go | ||
command_env.go | ||
command_ext.go | ||
command_fetch.go | ||
command_fsck.go | ||
command_init.go | ||
command_install.go | ||
command_lock.go | ||
command_logs.go | ||
command_ls_files.go | ||
command_pointer.go | ||
command_pre_push.go | ||
command_prune.go | ||
command_pull.go | ||
command_push.go | ||
command_smudge.go | ||
command_status.go | ||
command_track.go | ||
command_uninit.go | ||
command_uninstall.go | ||
command_untrack.go | ||
command_update.go | ||
command_version.go | ||
commands.go | ||
uploader.go |