I am building a stateless RESTful API using Pyramid framework. Now Pyramid gives a good testing skeleton to write unit tests, but we need to do view config, mocks, etc., to get tests working.
I was thinking about testing the API from the "outside", meaning using something like the requests library to drive the API as if it were being used by a real client, and "somehow" reporting failures just like unit tests.
Here are my questions...
- Is what I am thinking really absurd?
- Can these two approaches be used together? Can they be used exclusively?
- If these can be used together, what aspects should I test in unit tests and what from the outside?
- Anything else that's relevant in this context?
I guess, essentially, I am asking, what benefits do unit tests have over integration tests in a RESTful API testing context.
Aucun commentaire:
Enregistrer un commentaire