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

[tor-commits] [bridgedb/develop] Add unittest for del() of bridges.PluggableTransport.port property.



commit 868b6e62fe791ad01fab511107646ebf25342700
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Sun Dec 28 12:42:17 2014 +0000

    Add unittest for del() of bridges.PluggableTransport.port 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 23ee70b..794351f 100644
--- a/lib/bridgedb/test/test_bridges.py
+++ b/lib/bridgedb/test/test_bridges.py
@@ -470,6 +470,18 @@ class PluggableTransportTests(unittest.TestCase):
         pt = bridges.PluggableTransport()
         self.assertIsInstance(pt, bridges.PluggableTransport)
 
+    def test_PluggableTransport_port_del(self):
+        """The del method for the port property should reset the port to None.
+        """
+        pt = bridges.PluggableTransport(self.fingerprint,
+                                        "voltronPT", "1.2.3.4", 443,
+                                        {'sharedsecret': 'foobar'})
+        self.assertEqual(pt.port, 443)
+
+        del(pt.port)
+        self.assertIsNone(pt.port)
+        self.assertIsNone(pt._port)
+
     def test_PluggableTransport_parseArgumentsIntoDict_valid_list(self):
         """Parsing a valid list of PT args should return a dictionary."""
         pt = bridges.PluggableTransport()



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