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

vlorentz added inline comments.
swh/web/tests/api/views/test_content.py
104–121

This can probably be factorized in a for loop.

206–222

same

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

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

Update: factorize some code using for loops

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.