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

[tor-commits] [bridgedb/master] Add unittest for str(Bridge) without fingerprint or nickname.



commit ce197f4997d7eaef7694d17081c0a3ce96bd974c
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Thu Mar 26 23:48:56 2015 +0000

    Add unittest for str(Bridge) without fingerprint or nickname.
---
 lib/bridgedb/test/test_bridges.py |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/bridgedb/test/test_bridges.py b/lib/bridgedb/test/test_bridges.py
index 763e4c4..1592f00 100644
--- a/lib/bridgedb/test/test_bridges.py
+++ b/lib/bridgedb/test/test_bridges.py
@@ -912,6 +912,15 @@ class BridgeTests(unittest.TestCase):
                          ''.join(['$', '0'*40,
                                   '~', bridge.nickname]))
 
+    def test_Bridge_str_without_fingerprint_without_nickname(self):
+        """Calling str(Bridge) on a Bridge whose fingerprint and nickname were
+        not set should return a Bridge identifier string where the fingerprint
+        is all 0's and the nickname is "Unnamed".
+        """
+        bridge = bridges.Bridge()
+        identifier = str(bridge)
+        self.assertEqual(identifier, ''.join(['$', '0'*40, '~', 'Unnamed']))
+
     def test_Bridge_updateFromNetworkStatus_IPv4_ORAddress(self):
         """Calling updateFromNetworkStatus() with a descriptor which has an
         IPv4 address as an additional ORAddress should result in a



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