python-requests/tests/smoke/test.py
Adam Kolar 54447e6554 Import CI smoke test from RHEL
This is taken and edited from RHEL distgit tests/python-requests,
directory Sanity/smoke.
The commit hash this was copied from: 050c2979f27cc70506ddf669f9e0803a7b67c2d5

Only the necessary files were kept.

Co-authored-by: Lukas Zachar <lzachar@redhat.com>
2024-08-21 13:00:46 +02:00

12 lines
283 B
Python

import requests
from requests import *
class ExceptionRequests(Exception):
pass
if __name__=="__main__":
r=requests.get('https://redhat.com')
if r.status_code!=200 or \
not r.text or r.encoding.lower() != 'utf-8':
raise ExceptionRequests("Sanity error")