예제 #1
0
 def test_json(self):
     input_dict = dict(servers=dict(a=(2, 3)))
     expected_json = '{"servers":{"a":[2,3]}}'
     serializer = wsgi.JSONDictSerializer()
     result = serializer.serialize(input_dict)
     result = result.replace('\n', '').replace(' ', '')
     self.assertEqual(result, expected_json)
예제 #2
0
파일: test_wsgi.py 프로젝트: wzhmei/manila
 def test_json(self):
     input_dict = dict(servers=dict(a=(2, 3)))
     expected_json = six.b('{"servers":{"a":[2,3]}}')
     serializer = wsgi.JSONDictSerializer()
     result = serializer.serialize(input_dict)
     result = result.replace(six.b('\n'),
                             six.b('')).replace(six.b(' '), six.b(''))
     self.assertEqual(expected_json, result)
예제 #3
0
 def test_json(self):
     input_dict = dict(servers=dict(a=(2, 3)))
     expected_json = '{"servers":{"a":[2,3]}}'.encode("utf-8")
     serializer = wsgi.JSONDictSerializer()
     result = serializer.serialize(input_dict)
     result = result.replace(
         '\n'.encode("utf-8"), ''.encode("utf-8")).replace(
         ' '.encode("utf-8"), ''.encode("utf-8"))
     self.assertEqual(expected_json, result)