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

[tor-commits] [bridgedb/master] Add another test for Bridge.getBridgeLine() when the bridge is blocked.



commit 1d44a42fdec2763ab868c091756a1446eb839737
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Sat Apr 18 03:27:28 2015 +0000

    Add another test for Bridge.getBridgeLine() when the bridge is blocked.
---
 lib/bridgedb/test/test_bridges.py |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/lib/bridgedb/test/test_bridges.py b/lib/bridgedb/test/test_bridges.py
index e48e20a..d7dd810 100644
--- a/lib/bridgedb/test/test_bridges.py
+++ b/lib/bridgedb/test/test_bridges.py
@@ -1466,6 +1466,24 @@ class BridgeTests(unittest.TestCase):
         self.assertIn('179.178.155.140:36489', line)
         self.assertIn('2C3225C4805331025E211F4B6E5BF45C333FDD2C', line)
 
+    def test_Bridge_getBridgeLine_blocked_and_request_without_block(self):
+        """Calling getBridgeLine() with a valid request for bridges not blocked in
+        Iran, when the bridge is completely blocked in Iran, shouldn't return
+        a bridge line.
+        """
+        self.bridge.updateFromNetworkStatus(self.networkstatus)
+        self.bridge.updateFromServerDescriptor(self.serverdescriptor)
+        self.bridge.updateFromExtraInfoDescriptor(self.extrainfo)
+
+        self.bridge.setBlockedIn('ir')
+
+        request = BridgeRequestBase()
+        request.isValid(True)
+        request.withoutBlockInCountry('IR')
+        line = self.bridge.getBridgeLine(request)
+
+        self.assertIsNone(line)
+
     def test_Bridge_getBridgeLine_IPv6(self):
         """Calling getBridgeLine() with a valid request for IPv6 bridges
         should return a bridge line.



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