Add Descriptor Test Cases - gpaOliveira/SuperDiffer GitHub Wiki

Obtained from file: SuperDiffer/tests/test_descriptor.py

Test cases to verify and document the Add behavior on the controller and on the endpoints

[UNIT_TESTS] left add ok method

Add left descriptor and make sure all went fine

[UNIT_TESTS] left remove ok method

Add left descriptor and make sure it can be removed just fine

[UNIT_TESTS] left remove no left method

Do not add left descriptor and make sure the removal is not fine

[UNIT_TESTS] right add ok method

Add right descriptor and make sure all went fine

[UNIT_TESTS] center add ok method

Add center descriptor and make sure all went fine

[UNIT_TESTS] left remove wont affect others method

Add left descriptor and make sure it can be removed just fine, without affecting any other records

[UNIT_TESTS] left removal wont affect other ids method

Add left descriptor to ID 1 and ID 2 and make sure ID 2 can be removed without affecting any other records

[UNIT_TESTS] left add not ok method

Add left descriptor twice and make sure the second one doesn't work

[UNIT_TESTS] left add after removal method

Add left descriptor, delete it and make sure it can be added again just fine

[UNIT_TESTS] right add not ok method

Add right descriptor twice and make sure the second one doesn't work

[UNIT_TESTS] center add not ok method

Add center descriptor twice and make sure the second one doesn't work

[UNIT_TESTS] mixed add method

Mix add descriptors to make sure the twice add of each doesn't work

[UNIT_TESTS] removal all method

Add left and right descriptor to ID 1 and make sure it can be removed

[UNIT_TESTS] removal all without single descriptor method

Add left descriptor only to ID 1 and make sure remove all fails but didn't affected anything on the database

[UNIT_TESTS] removal all without all descriptor method

Try to remove all from an ID that doesn't have anything and ensure it fails but leaves the database intact

[UNIT_TESTS] removal all without any descriptor method

Try to remove all without any descriptor on the parameters list and ensure it ends ok but leaves the database intact

[UNIT_TESTS] removal all allow adding more method

Remove all from an ID and make sure we can add them again

[INTEGRATON_TESTS] integration left 201 method

Post to left endpoint and make sure all went well

[INTEGRATON_TESTS] integration right 201 method

Post to right endpoint and make sure all went well

[INTEGRATON_TESTS] integration left 400 due to repeated left value method

Post to left endpoint twice and make sure the second one doesn't work (right endpoint works the same so we don't need to cover it with another test)

[INTEGRATON_TESTS] integration left 400 due to bad base64 method

Post to left endpoint with bad base64 data and make sure it doesn't work

[INTEGRATON_TESTS] integration center 404 no endpoint method

Post to center endpoint to make sure it doesn't exists

[INTEGRATON_TESTS] integration mixed method

Mix posting to left and right endpoints twice and make sure the second one of each doesn't work

[INTEGRATON_TESTS] integration id nan 404 method

Post to right or left with a not-a-number ID to make sure it doesn't exists