예제 #1
0
파일: test_compat.py 프로젝트: hhco/txdarn
 def test_asJSON(self):
     self.assertEqual(C.asJSON({'a': [1]}),
                      b'{"a": [1]}')
예제 #2
0
파일: test_compat.py 프로젝트: hhco/txdarn
 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)