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

[tor-commits] [bridgedb/develop] Add unittest for bridgedb.bridges.BridgeAddressBase.country @property.



commit fdf4afad33f8759f4154797a4bd37d678ff40daa
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Thu Feb 19 00:42:18 2015 +0000

    Add unittest for bridgedb.bridges.BridgeAddressBase.country @property.
---
 lib/bridgedb/test/test_bridges.py |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/bridgedb/test/test_bridges.py b/lib/bridgedb/test/test_bridges.py
index f63b25e..d42fb24 100644
--- a/lib/bridgedb/test/test_bridges.py
+++ b/lib/bridgedb/test/test_bridges.py
@@ -406,6 +406,18 @@ class BridgeAddressBaseTests(unittest.TestCase):
         self.assertIsNone(self.bab.address)
         self.assertIsNone(self.bab._address)
 
+    def test_BridgeAddressBase_country(self):
+        """The getter method for the country property should get the
+        address's geoIP country code.
+        """
+        self.bab.address = '11.12.13.14'
+        self.assertEqual(self.bab.address, ipaddr.IPv4Address('11.12.13.14'))
+
+        cc = self.bab.country
+        self.assertIsNotNone(cc)
+        self.assertIsInstance(cc, basestring)
+        self.assertEqual(len(cc), 2)
+
 
 class PluggableTransportTests(unittest.TestCase):
     """Tests for :class:`bridgedb.bridges.PluggableTransport."""



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