PyAr / PyZombis

Programación Python para Zombis MOOC (código y materiales del curso abierto y masivo en linea)
GNU Affero General Public License v3.0
21 stars 47 forks source link

added e2e tests for CORS reddit api #330

Open abadoni5 opened 5 months ago

abadoni5 commented 5 months ago

Summary

closes #213, the original lessons used CORS, which failed the tests, since in pr #320 we are using new api (api.reddit.com) I have fixed it.

Checklist

Screenshots

Screenshot 2024-03-15 at 12 59 58 AM
abadoni5 commented 5 months ago

@reingart @NicolasSandoval, the previous attempt at adding e2e tests did not explicitly check for errors, I check the status code to check if the api is working properly handling this error earlier.

github-actions[bot] commented 5 months ago

Published to http://pyar.github.io/PyZombis/330/index.html

sujith-rek commented 5 months ago

image @abadoni5 The test you wrote for this gives this error, due to which test run is failing

sujith-rek commented 5 months ago

once check and do necessary changes

abadoni5 commented 5 months ago

@NicolasSandoval, the CORS error now is fixed with required tests keeping in mind the suggestions by @sujith-rek. Due the way GitHub handles running the tests the api is returning a 403 error but the code is running fine locally and the test is working as expected.

The test is working as expected and only fails due to how github handles their testing workflow.

github-actions[bot] commented 5 months ago

Published to http://pyar.github.io/PyZombis/330/index.html

github-actions[bot] commented 5 months ago

Published to http://pyar.github.io/PyZombis/330/index.html

NicolasSandoval commented 5 months ago

@abadoni5 Can you try with another "User-Agent". Try this instead: "Chrome/122.0.0.0"

github-actions[bot] commented 5 months ago

Published to http://pyar.github.io/PyZombis/330/index.html

abadoni5 commented 5 months ago

@NicolasSandoval added the new header, tests on github still fail. The test still works as expected locally. Let me know if you want any changes.

github-actions[bot] commented 5 months ago

Published to http://pyar.github.io/PyZombis/330/index.html

github-actions[bot] commented 5 months ago

Published to http://pyar.github.io/PyZombis/330/index.html