tests.integration package

Submodules

tests.integration.post_cars_call_test module

POST Call Integration Test

class tests.integration.post_cars_call_test.PostCarsCallTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing a JSON API implemented in Flask. POST Call Integration Test.

The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. It essentially means that POST request-URI should be of a collection URI.

POST is NOT idempotent. So if you retry the request N times, you will end up having N resources with N different URIs created on server.

Use POST when you want to add a child resource under resources collection.

setUp() → None[source]

Hook method for setting up the test fixture before exercising it.

test_post_car_admin()[source]

Test POST call using admin user credentials. :return:

test_post_car_non_admin()[source]

Test POST call using non admin user credentials. :return:

tests.integration.post_register_call_test module

POST Call Integration Test

class tests.integration.post_register_call_test.PostCarRegistrationCallTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing a JSON API implemented in Flask. POST Call Integration Test.

The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. It essentially means that POST request-URI should be of a collection URI.

POST is NOT idempotent. So if you retry the request N times, you will end up having N resources with N different URIs created on server.

Use POST when you want to add a child resource under resources collection.

setUp() → None[source]

Hook method for setting up the test fixture before exercising it.

test_post_register_car_admin()[source]

Test POST (register car) call using admin user credentials. :return:

test_post_register_car_non_admin()[source]

Test POST (register car) call using non admin user credentials. :return:

tests.integration.put_cars_call_test module

PUT Call Integration Test

class tests.integration.put_cars_call_test.PutCarsCallTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing a JSON API implemented in Flask. PUT Call Integration Test.

PUT method requests for the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource – an update operation will happen, otherwise create operation should happen if Request-URI is a valid resource URI (assuming client is allowed to determine resource identifier).

PUT method is idempotent. So if you send retry a request multiple times, that should be equivalent to single request modification.

Use PUT when you want to modify a singular resource which is already a part of resources collection. PUT replaces the resource in its entirety.

setUp() → None[source]

Hook method for setting up the test fixture before exercising it.

test_put_cars_update_admin()[source]

Test PUT call using admin user credentials. :return:

test_put_cars_update_non_admin()[source]

Test PUT call using non admin user credentials. :return:

Module contents