kscout / serverless-registry-api

API which curates serverless applications.
https://api.kscout.io
GNU General Public License v2.0
0 stars 1 forks source link

added source url field to app model, fixes #172 #173

Closed Noah-Huppert closed 5 years ago

Noah-Huppert commented 5 years ago

I am going to write tests for this.

Noah-Huppert commented 5 years ago

I have 3 choices of how to test this:

  1. Mock go-github client
  2. Write wrapper interface around usage of go-github client
  3. Use net/http/httptest package to mock GitHub API responses and still use the full go-github client with a custom BaseURL.

I like option 3. However this won't be perfect b/c if a API call works is highly dependent on the parameters passed to the API call. We must make sure we are testing that those parameters are OK.

I think that option 1 provides a solution to the problem with using option 3. If we mock out the behavior of a go-github client for certain method, as in make these methods search some test harness of the GitHub API which emulates a repository.