You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For more reliable client package which could be a golang SDK for Pouch developer, we should add more guarantee work on this.
When adding mock test for Pouch's client package, we could refer to PR #965 which could be regarded to be an example.
To be more specific, when doing mock test for API calling function in package client, we should add a mock server function in HTTPClient, then we simulate the action of server in the mock function.
Ⅰ. Issue Description
For more reliable client package which could be a golang SDK for Pouch developer, we should add more guarantee work on this.
When adding mock test for Pouch's client package, we could refer to PR #965 which could be regarded to be an example.
To be more specific, when doing mock test for API calling function in package client, we should add a mock server function in HTTPClient, then we simulate the action of server in the mock function.
Like:
In that
newMockClient(func(req *http.Request) (*http.Response, error)
is to simulate the handler of a server. But actually it is in the client side.So when we call
client.ContainerStart
, the request will be dealt bynewMockClient
.Help Wanted
There are still many API calling functions which misses such kind of mock test. Help wanted for the solving. 👍 🛩 🦁 🍺
The text was updated successfully, but these errors were encountered: