Page MenuHomeSoftware Heritage

Remove mocks and use hypothesis in api content endpoints tests
ClosedPublic

Authored by anlambert on Dec 14 2018, 6:43 PM.

Details

Summary

Third diff exposing the work I have done so far on improving swh-web tests.
In this one, let's start to remove the mocks by rewriting the tests
using hypothesis for the content endpoints in the web api.

Related T1271

Depends on D826

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

anlambert created this revision.Dec 14 2018, 6:43 PM
vlorentz added inline comments.
swh/web/tests/api/views/test_content.py
105–122

This can probably be factorized in a for loop.

206–222

same

vlorentz added inline comments.Dec 14 2018, 7:38 PM
swh/web/tests/api/views/test_content.py
100–101

This condition is computed twice, it should be a class variable or a global instead.

146–150

same

anlambert retitled this revision from swh-web: Remove mocks and use hypothesis in api content endpoints tests to Remove mocks and use hypothesis in api content endpoints tests.Dec 17 2018, 10:43 AM
anlambert updated this revision to Diff 2671.Dec 17 2018, 4:40 PM

Rebase after D825 and D826 updates

anlambert updated this revision to Diff 2678.Dec 17 2018, 5:22 PM

Update: Rebase after D826 update and use variables to skip some tests

anlambert updated this revision to Diff 2690.Dec 18 2018, 2:34 PM

Update: factorize some code using for loops

ardumont accepted this revision.Dec 18 2018, 2:45 PM
This revision is now accepted and ready to land.Dec 18 2018, 2:45 PM
This revision was automatically updated to reflect the committed changes.