示例#1
0
 def test_asJSON(self):
     self.assertEqual(C.asJSON({'a': [1]}),
                      b'{"a": [1]}')
示例#2
0
 def test_asJSON_withMoreArguments(self):
     self.assertEqual(C.asJSON({"b": [0], "a": [1]},
                               sort_keys=True),
                      b'{"a": [1], "b": [0]}')
示例#3
0
文件: protocol.py 项目: hhco/txdarn
def sockJSJSON(data, cls=None):
    # no spaces
    return asJSON(data, separators=(',', ':'), cls=cls)