[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [bridgedb/develop] Change test_HTTPServer.py to account for '<br />'s in bridge lines.
commit d8b9815c4e612834b7bb6be35ac1476617fa31ba
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date: Thu Jan 22 21:56:58 2015 +0000
Change test_HTTPServer.py to account for '<br />'s in bridge lines.
* FIXES three failing unittests in test_HTTPServer.py:
- test_render_GET_RTLlang
- test_render_GET_RTLlang_obfs3
- test_render_GET_vanilla
---
lib/bridgedb/test/test_HTTPServer.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/bridgedb/test/test_HTTPServer.py b/lib/bridgedb/test/test_HTTPServer.py
index 42fbdef..fccbee8 100644
--- a/lib/bridgedb/test/test_HTTPServer.py
+++ b/lib/bridgedb/test/test_HTTPServer.py
@@ -539,7 +539,15 @@ class WebResourceBridgesTests(unittest.TestCase):
soup = BeautifulSoup(page)
well = soup.find('div', {'class': 'bridge-lines'})
content = well.renderContents().strip()
- bridges = [b.strip() for b in content.splitlines()]
+ lines = content.splitlines()
+
+ bridges = []
+ for line in lines:
+ bridgelines = line.split('<br />')
+ for bridge in bridgelines:
+ if bridge: # It still could be an empty string at this point
+ bridges.append(bridge)
+
return bridges
def test_render_GET_vanilla(self):
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits