示例#1
0
 def ok_response(self, response):
     self.set_header('Content-Type', 'application/json')
     msg = {
         'stat': 'OK',
         # Make sure there aren't any bytestrings in response,
         # as those aren't JSONizable.
         'response': recursive_unicode(response)
     }
     # buf = strutil.enc_json(msg)
     # self.finish(buf)
     self.write(msg)
示例#2
0
 def test_recursive_unicode(self):
     self.assertEqual(recursive_unicode("rawr"), u"rawr")
     self.assertEqual(recursive_unicode({"rawr": "rawr"}),
                      {"rawr": u"rawr"})
     self.assertEqual(recursive_unicode(["rawr", "rawr"]),
                      [u"rawr", u"rawr"])
示例#3
0
 def test_recursive_unicode(self):
     self.assertEqual(recursive_unicode("rawr"), u"rawr")
     self.assertEqual(
         recursive_unicode({"rawr": "rawr"}), {"rawr": u"rawr"})
     self.assertEqual(
         recursive_unicode(["rawr", "rawr"]), [u"rawr", u"rawr"])