Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mocking of requests in EspritParcParser tests #2652

Merged
merged 6 commits into from May 6, 2021

Conversation

Chatewgne
Copy link
Contributor

Add missing mock for this HEAD request on attachments' URLs

@submarcos
Copy link
Member

submarcos commented May 5, 2021

Pour etre plus propre, il aurait fallu mocker le get du json du endpoint avec un json, le head avec un contenu attendu par head (response.headers), puis le get des images avec un autre mock. C'est là ou c'est touchy, quand tu dois mocker 2x get avec des contenus différents, il faut specifier le path local de get au lieu de requests.get. la çà va marcher mais du coup c'est pas vraiment un contenu de head que tu mock, et ton requests.get contient a la fois le json de l'api et le content de l'image (et ton request.head aussi, alors qu'il pas censé avoir d'image ni le contenu de la reponse api en json)

@cypress
Copy link

cypress bot commented May 5, 2021



Test summary

18 0 0 0


Run details

Project Geotrek-admin
Status Passed
Commit 3ab0e38
Started May 5, 2021 4:29 PM
Ended May 5, 2021 4:32 PM
Duration 02:54 💡
OS Linux Ubuntu Linux - 14.04
Browser Electron 80

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@codecov
Copy link

codecov bot commented May 5, 2021

Codecov Report

Merging #2652 (3ab0e38) into master (e15fb84) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2652   +/-   ##
=======================================
  Coverage   97.15%   97.16%           
=======================================
  Files         267      267           
  Lines       17824    17824           
=======================================
+ Hits        17317    17318    +1     
+ Misses        507      506    -1     
Impacted Files Coverage Δ
geotrek/tourism/parsers.py 96.35% <ø> (ø)
geotrek/common/parsers.py 83.60% <0.00%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e15fb84...3ab0e38. Read the comment docs.

@submarcos submarcos merged commit b315654 into master May 6, 2021
@numahell numahell deleted the fix_espritparc_tests branch May 26, 2021 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants