New upstream snapshot.
Kali Janitor
2 years ago
0 | Metadata-Version: 1.1 | |
1 | Name: adns | |
2 | Version: 1.4-py1 | |
3 | Summary: An interface to GNU adns - python3 port | |
4 | Home-page: https://github.com/trolldbois/python3-adns/ | |
5 | Author: Loic Jaquemet | |
6 | Author-email: [email protected] | |
7 | License: GPL | |
8 | Download-URL: https://github.com/trolldbois/python3-adns/archive/master.tar.gz | |
9 | Description: adns-python is a Python module that interfaces to the adns asynchronous | |
10 | resolver library. | |
11 | ||
12 | http://www.gnu.org/software/adns/ | |
13 | ||
14 | Platform: UNKNOWN | |
15 | Classifier: Development Status :: 6 - Mature | |
16 | Classifier: Intended Audience :: Developers | |
17 | Classifier: License :: OSI Approved :: GNU General Public License (GPL) | |
18 | Classifier: Operating System :: POSIX | |
19 | Classifier: Topic :: Internet :: Name Service (DNS) | |
20 | Classifier: Topic :: Software Development :: Libraries |
0 | python-adns (1.4~py1+git20131202.1.20f4bb5-0kali1) UNRELEASED; urgency=low | |
1 | ||
2 | * New upstream snapshot. | |
3 | ||
4 | -- Kali Janitor <[email protected]> Sun, 30 May 2021 19:11:50 -0000 | |
5 | ||
0 | 6 | python-adns (1.4~py1-0kali1) kali-dev; urgency=medium |
1 | 7 | |
2 | 8 | * New upstream version 1.4~py1 |
0 | #!/usr/bin/env python | |
1 | ||
2 | """Test functions.""" | |
3 | ||
4 | import adns | |
5 | ||
6 | import socket | |
7 | import ipaddress | |
8 | import unittest | |
9 | ||
10 | def get_ip(hostname): | |
11 | return socket.gethostbyname_ex(hostname)[2][0] | |
12 | ||
13 | class TestADNS(unittest.TestCase): | |
14 | ||
15 | def setUp(self): | |
16 | self.resolver = adns.init() | |
17 | ||
18 | def test_synchronous(self): | |
19 | # sync | |
20 | # Results are generally returned as a 4-tuple: status, CNAME, expires, answer | |
21 | host = "google-public-dns-a.google.com." | |
22 | result = self.resolver.synchronous(host, adns.rr.A) | |
23 | self.assertEqual(result[0],0) | |
24 | ip1 = ipaddress.ip_address(result[3][0]) | |
25 | ip2 = ipaddress.ip_address(get_ip(host)) | |
26 | self.assertEqual(ip1,ip2) | |
27 | ||
28 | #def submit(self, qname, rr, flags=0, callback=None, extra=None): | |
29 | ||
30 | #def submit_reverse(self, qname, rr, flags=0, callback=None, extra=None): | |
31 | ||
32 | #def submit_reverse_any(self, qname, rr, flags=0, callback=None, extra=None): | |
33 | ||
34 | #def cancel(self, query): | |
35 | ||
36 | #def run(self, timeout=0): | |
37 | ||
38 | #def finished(self): | |
39 | ||
40 | #def finish(self): | |
41 | ||
42 | #def run_max(self, max): | |
43 | ||
44 | #def globalsystemfailure(self): | |
45 | ||
46 | ||
47 | ||
48 | ||
49 | ||
50 | if __name__ == '__main__': | |
51 | unittest.main() |