Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add method to test server to allow multiple responses from the same e…
…ndpoint (#40) Currently the test server only returns one response value from a mocked endpoint. This PR adds a new method `RegisterMethodResponse` that registers a list of responses that an endpoint will return when it is called. For example: ``` testServer := testphabserver.New() defer testServer.Close() testServer.RegisterCapabilities() // first PHID lookup testServer.RegisterMethodResponse("phid.lookup", http.StatusOK, m{ "result": m{ "PHID-USER-user2": m{ "type": "USER", "name": "id-user2", }, }, }) // second PHID lookup testServer.RegisterMethodResponse("phid.lookup", http.StatusOK, m{ "result": m{ "PHID-USER-user1": m{ "type": "USER", "name": "id-user1", }, }, }) Co-authored-by: jkim <[email protected]>
- Loading branch information