Commit 5d8d9b77 authored by Vincent Pelletier's avatar Vincent Pelletier

test: io.StringIO expects unicode object as argument.

parent 15176ff0
...@@ -1655,37 +1655,37 @@ class CaucaseTest(unittest.TestCase): ...@@ -1655,37 +1655,37 @@ class CaucaseTest(unittest.TestCase):
'PATH_INFO': '/cau/crt/renew', 'PATH_INFO': '/cau/crt/renew',
'REQUEST_METHOD': 'PUT', 'REQUEST_METHOD': 'PUT',
'CONTENT_TYPE': 'application/json', 'CONTENT_TYPE': 'application/json',
'wsgi.input': StringIO('{'), 'wsgi.input': StringIO(u'{'),
})[0], 400) })[0], 400)
self.assertEqual(request({ self.assertEqual(request({
'PATH_INFO': '/cau/crt/revoke', 'PATH_INFO': '/cau/crt/revoke',
'REQUEST_METHOD': 'PUT', 'REQUEST_METHOD': 'PUT',
'CONTENT_TYPE': 'application/json', 'CONTENT_TYPE': 'application/json',
'wsgi.input': StringIO('{"digest": null}'), 'wsgi.input': StringIO(u'{"digest": null}'),
})[0], UNAUTHORISED_STATUS) })[0], UNAUTHORISED_STATUS)
self.assertEqual(request({ self.assertEqual(request({
'PATH_INFO': '/cau/crt/revoke', 'PATH_INFO': '/cau/crt/revoke',
'REQUEST_METHOD': 'PUT', 'REQUEST_METHOD': 'PUT',
'CONTENT_TYPE': 'application/json', 'CONTENT_TYPE': 'application/json',
'wsgi.input': StringIO('{"digest":"sha256","payload":""}'), 'wsgi.input': StringIO(u'{"digest":"sha256","payload":""}'),
})[0], 400) })[0], 400)
self.assertEqual(request({ self.assertEqual(request({
'PATH_INFO': '/cau/crt/a', 'PATH_INFO': '/cau/crt/a',
'REQUEST_METHOD': 'PUT', 'REQUEST_METHOD': 'PUT',
'CONTENT_TYPE': 'text/plain', 'CONTENT_TYPE': 'text/plain',
'wsgi.input': StringIO(''), 'wsgi.input': StringIO(u''),
})[0], 400) })[0], 400)
self.assertEqual(request({ self.assertEqual(request({
'PATH_INFO': '/cau/crt/123', 'PATH_INFO': '/cau/crt/123',
'REQUEST_METHOD': 'PUT', 'REQUEST_METHOD': 'PUT',
'CONTENT_TYPE': 'text/plain', 'CONTENT_TYPE': 'text/plain',
'wsgi.input': StringIO(''), 'wsgi.input': StringIO(u''),
})[0], UNAUTHORISED_STATUS) })[0], UNAUTHORISED_STATUS)
self.assertEqual(request({ self.assertEqual(request({
'PATH_INFO': '/cau/crt/123', 'PATH_INFO': '/cau/crt/123',
'REQUEST_METHOD': 'PUT', 'REQUEST_METHOD': 'PUT',
'CONTENT_TYPE': 'text/plain', 'CONTENT_TYPE': 'text/plain',
'wsgi.input': StringIO('foo'), 'wsgi.input': StringIO(u'foo'),
})[0], 400) })[0], 400)
self.assertEqual(request({ self.assertEqual(request({
'PATH_INFO': '/cau/crt/123', 'PATH_INFO': '/cau/crt/123',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment