Unit Test for Python Eve Web Services
We developed an API using a framework python eve
. Is there a way to write unit test examples for the API that we developed in EVE
. Is there a unit test case component in the kit python eve
. I need to link them to my continuous integration setup. If so, please help me with the steps on how to do this.
source to share
You can start by exploring your own set . There are over 600 examples. There are two base classes that provide many useful methods: TestMinimal
and TestBase
. Almost all other test classes inherit from any of them. You probably want to use TestMinimal
as it takes care of setting up and dropping the MongoDB connection for you. It also provides things like assert200
, assert404
etc.
In general, you use an object test_client
, just like you would with the flask itself. Take a look at Testing Flash Applications and Eve's Executing Tests page.
source to share