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
Branch
tests-improvements-diff3
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 3105
Build 3968: tox-on-jenkinsJenkins
Build 3967: arc lint + arc unit

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.

210–230

same

swh/web/tests/api/views/test_content.py
83–100

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

153–162

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.