HomeSoftware Heritage

Add pytest fixture to allow mocking requests with data file

Description

Add pytest fixture to allow mocking requests with data file

Roughly, the idea is that http queries are transformed into file queries within
http context. If found, the data file is served or not (404). This translates
into query response so that the code can actually complete as usual.

For technical reasons the pytest plugin is in a dedicated non-swh module. This
is actually required for the pytest plugin loading mecanism to work without
hijacking the loading of swh packages. See [1] for more details.

[1] https://github.com/pytest-dev/pytest/issues/2042

Details

Provenance
ardumontAuthored on Oct 7 2019, 5:52 PM
ardumontPushed on Oct 9 2019, 10:44 AM
Differential Revision
D2082: Add pytest fixture to allow mocking requests with data file
Parents
rDCORE61c831466f58: tox.ini: Use tests installed files instead of working directory
Branches
Unknown
Tags
Unknown
References
tag: v0.0.71
Build Status
Buildable 8205
Build 11843: test-and-buildJenkins