Skip to content

Commit

Permalink
Change duplicate txrecaptcha unittest to check ConnectionDone result.
Browse files Browse the repository at this point in the history
  • Loading branch information
isislovecruft committed Mar 12, 2014
1 parent d3ebc3c commit d1f22a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/bridgedb/test/test_txrecaptcha.py
Expand Up @@ -14,6 +14,7 @@
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
Expand Down Expand Up @@ -94,10 +95,11 @@ def _test(self, responseBody, connCloseError):

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")
Expand Down

0 comments on commit d1f22a1

Please sign in to comment.