Files
packages/lang/python/python-dns/test.sh
Alexandru Ardelean 362d823329 python-dns: bump to 2.8.0
Changelog: https://github.com/rthalley/dnspython/blob/master/CHANGELOG.rst

Multiple minor releases since 2.4.1 adding new record types,
improved DNSSEC support, and bug fixes.
Add test.sh to verify DNS name parsing and rdatatype lookups.

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
2026-04-09 08:00:48 +03:00

23 lines
509 B
Bash
Executable File

#!/bin/sh
[ "$1" = python3-dns ] || exit 0
python3 - << 'EOF'
import dns
import dns.name
import dns.rdatatype
import dns.rdata
import dns.rdataset
import dns.message
import dns.resolver
n = dns.name.from_text("www.example.com.")
assert str(n) == "www.example.com.", f"unexpected name: {n}"
assert n.is_absolute()
parent = dns.name.from_text("example.com.")
assert n.is_subdomain(parent)
rdtype = dns.rdatatype.from_text("A")
assert rdtype == dns.rdatatype.A
assert dns.rdatatype.to_text(rdtype) == "A"
EOF