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

[tor-commits] [ooni-probe/master] Make the geoip related tests make a less stronger assertion.



commit 9d44242c98099a532b89dcd9738a71c7c680235c
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Thu Feb 20 12:21:40 2014 +0000

    Make the geoip related tests make a less stronger assertion.
---
 ooni/nettest.py          |    2 +-
 ooni/tests/test_geoip.py |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ooni/nettest.py b/ooni/nettest.py
index aa8a21d..943aeba 100644
--- a/ooni/nettest.py
+++ b/ooni/nettest.py
@@ -245,7 +245,7 @@ class NetTestLoader(object):
                 'ip': '127.0.0.1'
         }
 
-        if config.probe_ip.address and (config.privacy.includeip or \
+        if config.probe_ip and config.probe_ip.address and (config.privacy.includeip or \
                 config.privacy.includeasn or \
                 config.privacy.includecountry or \
                 config.privacy.includecity):
diff --git a/ooni/tests/test_geoip.py b/ooni/tests/test_geoip.py
index ac18a2e..6ae31f3 100644
--- a/ooni/tests/test_geoip.py
+++ b/ooni/tests/test_geoip.py
@@ -11,8 +11,8 @@ class TestGeoIP(unittest.TestCase):
  
     def test_ip_to_location(self):
         location = geoip.IPToLocation('8.8.8.8')
-        assert location['countrycode'] == 'US'
-        assert location['asn'] == 'AS15169'
+        assert 'countrycode' in location
+        assert 'asn' in location
         assert 'city' in location
 
     @defer.inlineCallbacks



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