Debian Codegraph @

debian/tests/run

raw
1 #!/bin/bash
2 set -e
3
4 echo "Running maintainer tests for aiodns package"
5
6 # Use py3versions --supported as lintian expects
7 PYVERSIONS=$(py3versions --supported)
8
9 if [ -z "$PYVERSIONS" ]; then
10 echo "No supported Python 3 versions found, using python3"
11 PYVERSIONS="python3"
12 fi
13
14 for py in $PYVERSIONS; do
15 echo "Testing with $py"
16
17 # Test 1: Basic import
18 $py -c "import aiodns; print('PASS: aiodns imports correctly with $py')"
19
20 # Test 2: Resolver creation
21 $py -c "
22 import aiodns
23 import asyncio
24 loop = asyncio.new_event_loop()
25 asyncio.set_event_loop(loop)
26 resolver = aiodns.DNSResolver(loop=loop)
27 print('PASS: DNSResolver creation works with $py')
28 "
29
30 # Test 3: Error module
31 $py -c "
32 import aiodns.error
33 print('PASS: Error module available with $py')
34 "
35
36 # Test 4: Basic attributes
37 $py -c "
38 import aiodns
39 import asyncio
40 loop = asyncio.new_event_loop()
41 asyncio.set_event_loop(loop)
42 r = aiodns.DNSResolver(loop=loop)
43 assert hasattr(r, 'query'), 'Missing query method'
44 assert hasattr(r, 'gethostbyname'), 'Missing gethostbyname method'
45 print('PASS: Basic API methods present with $py')
46 "
47
48 # Test 5: Basic functionality
49 $py -c "
50 import asyncio
51 import aiodns
52
53 async def test_basic():
54 resolver = aiodns.DNSResolver()
55 assert hasattr(resolver, 'query')
56 assert hasattr(resolver, 'gethostbyname')
57 print('PASS: Basic functionality confirmed with $py')
58
59 asyncio.run(test_basic())
60 "
61
62 echo "All tests passed for $py"
63 echo "---"
64 done
65
66 echo "All tests passed successfully for all Python versions"