[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Add example usage of DNS Test Template



commit 3e364fa31d7659692ed3c6a2c4bd3387a336524e
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Tue Nov 20 19:58:36 2012 +0100

    Add example usage of DNS Test Template
---
 nettests/examples/example_dnst.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/nettests/examples/example_dnst.py b/nettests/examples/example_dnst.py
new file mode 100644
index 0000000..b06e9af
--- /dev/null
+++ b/nettests/examples/example_dnst.py
@@ -0,0 +1,11 @@
+from ooni.templates.dnst import DNSTest
+
+class ExampleDNSTest(DNSTest):
+    def test_a_lookup(self):
+        def gotResult(result):
+            # Result is an array containing all the A record lookup results
+            print result
+
+        d = self.performALookup('torproject.org', ('8.8.8.8', 53))
+        d.addCallback(gotResult)
+        return d

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits