Files
packages/lang/python/python-requests/test.sh
Alexandru Ardelean 2ad4889f50 python-requests: bump to 2.33.1
Changes since 2.32.5:
- Security fix for CVE-2026-25645 in extract_zipped_paths utility
- Migrated to PEP 517 build system
- Added inline type hints throughout the library
- Fixed Content-Type header parsing for malformed values

Also add test.sh to verify core API imports and PreparedRequest.

Link: https://github.com/psf/requests/blob/main/HISTORY.md
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
2026-04-02 19:23:54 +03:00

41 lines
1.1 KiB
Bash

#!/bin/sh
[ "$1" = python3-requests ] || exit 0
python3 - << 'EOF'
import requests
# Verify version and key attributes
assert requests.__version__
# Verify core API is present
assert hasattr(requests, 'get')
assert hasattr(requests, 'post')
assert hasattr(requests, 'put')
assert hasattr(requests, 'delete')
assert hasattr(requests, 'head')
assert hasattr(requests, 'Session')
assert hasattr(requests, 'Request')
assert hasattr(requests, 'Response')
assert hasattr(requests, 'PreparedRequest')
# Test Session creation and basic functionality
s = requests.Session()
assert s is not None
# Test that Request object can be created and prepared
req = requests.Request('GET', 'http://example.com', headers={'User-Agent': 'test'})
prepared = req.prepare()
assert prepared.method == 'GET'
assert prepared.url == 'http://example.com/'
assert prepared.headers['User-Agent'] == 'test'
# Test exceptions are importable
from requests.exceptions import (
RequestException, ConnectionError, HTTPError, URLRequired,
TooManyRedirects, Timeout, ConnectTimeout, ReadTimeout
)
print("requests OK")
EOF