feat(py): step 1 refinement — error-path example configs for simple.py
- python/configs/: 7 purpose-built config files, one per error class: all-ok.txt, dns-failure.txt, connection-refused.txt, timeout.txt, tls-errors.txt (badssl.com), http-errors.txt (real 404 paths on stable hosts), mixed.txt (one of each, no timeout) - python/configs/usage.md: runnable sh commands + expected output per config, plus quick-sweep and full-sweep loops; commands written for running from the python/ directory - docs/custom-usage-examples.md: example 11 added (all failure classes at once) - docs/usage/py-simple.md: added pointer to python/configs/ and corrected limitation note (4xx/5xx are FAIL, not OK) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
21
python/configs/http-errors.txt
Normal file
21
python/configs/http-errors.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
# HTTP error status codes — urllib.request.urlopen() raises HTTPError for
|
||||
# 4xx/5xx responses, so simple.py reports these as FAIL even though the server
|
||||
# responded. The URLs below are real paths that reliably return 404 on stable
|
||||
# public servers.
|
||||
#
|
||||
# Note: a genuine 500 from a well-known server is hard to provoke on demand.
|
||||
# These 404s are sufficient to demonstrate that HTTP errors are treated as FAIL.
|
||||
#
|
||||
# Requires internet access.
|
||||
#
|
||||
# Run: python3.14 python/simple.py python/configs/http-errors.txt
|
||||
# Expected exit code: 1
|
||||
|
||||
# 404 from Google
|
||||
https://www.google.com/this-page-does-not-exist-at-all-1234567890
|
||||
|
||||
# 404 from GitHub
|
||||
https://github.com/this-repo-does-not-exist-abcxyz123/no-way
|
||||
|
||||
# 404 from IANA
|
||||
https://www.iana.org/this-page-does-not-exist-either
|
||||
Reference in New Issue
Block a user