Zoho
Zoho copied to clipboard
TODO
- Writing units tests
- setup http client and server for mocking endpoints and responses
- provide extremely simple way for contributors to provide an endpoint unit test
- Add a
map[string]interface{}
to response structs and decode JSON into it as well as the root struct- this could be a field, accessed as normal, or an embedded struct that provides methods for accessing the decoded values
- Write a different
TokenLoaderSaver
interface example because AppEngine subpackages have been deprecated AFAIK - Research Zoho docs to find all the possible HTTP request body encoding formats.
- Figure out how to allow users to add custom fields in responses/requests. This may require embedding structs in a different way.
Please create a new issue if you decided to work on these.
@schmorrison I will pick first thing first, Writing unit tests. Will start with Zoho expense api to add unit tests for it. PR should contain support added + new unit tests. Hope to complete it soon.
Make sure to setup a mock http client/server and a schema so contributors can provide unit test very easily.
On Tue., Aug. 24, 2021, 6:26 a.m. Ashish Nigam, @.***> wrote:
@schmorrison https://github.com/schmorrison I will pick first thing first, Writing unit tests. Will start with Zoho expense api to add unit tests for it. PR should contain support added + new unit tests. Hope to complete it soon.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/schmorrison/Zoho/issues/33#issuecomment-904593035, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEUOI5XUWRRHUFPRLBJBDDT6OFWHANCNFSM5CSACIPQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
@ashishsnigam Any progress on this? If I have some time this weekend I could review what you have, or I could take a run at it if you haven't got a start yet.
@schmorrison I am still not able to start working on it due to time crunch but I hope to start working on it October onwards only. Sorry for it.
@ashishsnigam I've just pushed some testing stuff, I never tried on a data endpoint but did test on the OAuth endpoints. You should be able to write a test for a specific endpoint pretty simply , it won't actually send the request to Zoho but we can test the marshal/unmarshal body, authentication, etc.
If you want an example let me know, but it should be pretty straightforward. You can check oauth_test.go
for how I tested to OAuth endpoints with the current test struct.
@schmorrison Thanks. Will try to check it out soon but too busy with day job.
- Create a http handler that simplifies catching OAuth redirect when not a localhost address.