Add timeout to POST request (#19)

* fix: add timeout to POST request
* fix: CI job could not find Pytest
* fix: correct coverage report path
* fix: correct coverage source path
This commit is contained in:
2022-12-30 20:45:43 +00:00
committed by GitHub
parent cf290152c5
commit 95a3544e3e
3 changed files with 8 additions and 13 deletions

View File

@ -26,7 +26,8 @@ def send_page(name: str, email: str, message: str) -> tuple:
req = requests.post(
api_url,
json=payload,
headers={'Content-Type': 'application/json'}
headers={'Content-Type': 'application/json'},
timeout=5
)
if req.status_code == 200 and req.json().get('status') == 1: