Unit testing is mainly used to test smaller parts of your code, like a single class or function. But you can repurpose unit testing frameworks into API testing frameworks with libraries that combine an HTTP client with assertion functions that cover things you typically expect from an API response, such as status codes and headers. Apiritif is one such library for the Python language. My latest guest post for BlazeMeter is a quick tutorial that shows you how to build an API test with Python, nose, and Apiritif. Check it out on the BlazeMeter blog. You can also find a small code snippet on thiscodeWorks.
Disclosure: This work was paid for by BlazeMeter.