Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Would someone suggest a way to mock dataiku.api_client().list_users(). I tried several different ways and none seems to be working.
I have a method to get a list of users by calling dataiku.api_client().list_users() and process it. Now I would like to write a unit test for my processing logic, but does not require to test Dataiku's list_users method. What will be the best way to mock the list_users() method and in general any Dataiku's APIs?
Personally I think you should not spend time on this. The Dataiku APIs are well understood, very solid and do not change that often. Specially with the list_users() API being read only and pretty simple. We have written a large amount of code using the Dataiku API and we barely see any issues, most of which are documented in the release notes. If you still want to test your API code I would suggest to write a regression pack which uses all the APIs you want to test and has expected inputs and outputs. Then run it against a live DSS instance running the version you want to test against.