[tor-commits] [bridgedb/develop] Change duplicate txrecaptcha unittest to check ConnectionDone result.
isis at torproject.org
isis at torproject.org
Sun Mar 16 16:38:46 UTC 2014
commit d1f22a1d8e081b0e2bd6bf6858f85c909a04a7da
Author: Isis Lovecruft <isis at torproject.org>
Date: Wed Mar 12 21:41:49 2014 +0000
Change duplicate txrecaptcha unittest to check ConnectionDone result.
---
lib/bridgedb/test/test_txrecaptcha.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/bridgedb/test/test_txrecaptcha.py b/lib/bridgedb/test/test_txrecaptcha.py
index dc41df4..1755011 100644
--- a/lib/bridgedb/test/test_txrecaptcha.py
+++ b/lib/bridgedb/test/test_txrecaptcha.py
@@ -14,6 +14,7 @@ import logging
from twisted.internet import defer
from twisted.internet import reactor
from twisted.internet.base import DelayedCall
+from twisted.internet.error import ConnectionDone
from twisted.internet.error import ConnectionLost
from twisted.internet.error import ConnectionRefusedError
from twisted.test import proto_helpers
@@ -94,10 +95,11 @@ class RecaptchaResponseProtocolTests(unittest.TestCase):
def test_trueResponse(self):
"""A valid API response which states 'true' should result in
- ``RecaptchaResponse.is_valid`` being ``True``.
+ ``RecaptchaResponse.is_valid`` being ``True`` after receiving a
+ ``ConnectionDone``.
"""
responseBody = "true\nsome-reason-or-another\n"
- response = self._test(responseBody, ResponseDone)
+ response = self._test(responseBody, ConnectionDone)
self.assertIsInstance(response, txrecaptcha.RecaptchaResponse)
self.assertTrue(response.is_valid)
self.assertEqual(response.error_code, "some-reason-or-another")
More information about the tor-commits
mailing list