summaryrefslogtreecommitdiffstats
path: root/lang/python/python-urllib3/test.sh
blob: 31237f35b50ff93c65ed66179c683ed45979f154 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

[ "$1" = python3-urllib3 ] || exit 0

python3 - << 'EOF'
import urllib3

# Verify version
assert urllib3.__version__

# Verify core classes are importable
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool, PoolManager
from urllib3.util.retry import Retry
from urllib3.util.timeout import Timeout
from urllib3.exceptions import (
    MaxRetryError, TimeoutError, HTTPError,
    NewConnectionError, DecodeError
)

# Test Retry configuration
retry = Retry(total=3, backoff_factor=0.5)
assert retry.total == 3

# Test Timeout configuration
timeout = Timeout(connect=5.0, read=10.0)
assert timeout.connect_timeout == 5.0

# Test PoolManager creation
pm = PoolManager(num_pools=5, maxsize=10)
assert pm is not None

print("urllib3 OK")
EOF