0

Lets say, there is one API, that actually takes input from the frontend , validates it and stores in the database. If I do functional testing, I can call the API directly, but it triggers/ inserts the actual payload to the database.

How do we figure out to write unit test?

I have searched about various libraries like monkeypatch, Mockito, and Python built-in mock and patch functions, but couldn't find enough / clear way to implement them.
Can someone take up time to give an example please

4

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.