From: MinRK Date: Mon, 23 Dec 2013 22:23:36 +0000 (-0800) Subject: expect log message in test_decode_argument_invalid_unicode X-Git-Tag: v3.2.0b1~20^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F963%2Fhead;p=thirdparty%2Ftornado.git expect log message in test_decode_argument_invalid_unicode --- diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index f4fa03a66..e12f7ec0e 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -588,10 +588,11 @@ class WSGISafeWebTest(WebTestCase): def test_decode_argument_invalid_unicode(self): # test that invalid unicode in URLs causes 400, not 500 - response = self.fetch("/typecheck/invalid%FF") - self.assertEqual(response.code, 400) - response = self.fetch("/typecheck/invalid?foo=%FF") - self.assertEqual(response.code, 400) + with ExpectLog(gen_log, ".*Invalid unicode.*"): + response = self.fetch("/typecheck/invalid%FF") + self.assertEqual(response.code, 400) + response = self.fetch("/typecheck/invalid?foo=%FF") + self.assertEqual(response.code, 400) def test_decode_argument_plus(self): # These urls are all equivalent.