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>
12 lines
283 B
Python
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")
|