Commit 67ff28d5 authored by chenzhengzhang's avatar chenzhengzhang
Browse files

[trac253] fix some comments and unittest

parent 3c06d0d6
......@@ -38,7 +38,6 @@ static PyObject* MessageRenderer_getLength(s_MessageRenderer* self);
static PyObject* MessageRenderer_isTruncated(s_MessageRenderer* self);
static PyObject* MessageRenderer_getLengthLimit(s_MessageRenderer* self);
static PyObject* MessageRenderer_getCompressMode(s_MessageRenderer* self);
// TODO: set/get compressmode
static PyObject* MessageRenderer_setTruncated(s_MessageRenderer* self);
static PyObject* MessageRenderer_setLengthLimit(s_MessageRenderer* self, PyObject* args);
static PyObject* MessageRenderer_setCompressMode(s_MessageRenderer* self, PyObject* args);
......@@ -206,7 +205,8 @@ MessageRenderer_setCompressMode(s_MessageRenderer* self,
Py_RETURN_NONE;
} else {
PyErr_SetString(PyExc_TypeError,
"Message mode must be Message.PARSE or Message.RENDER");
"MessageRenderer compress mode must be MessageRenderer.CASE_INSENSITIVE"
"or MessageRenderer.CASE_SENSITIVE");
return (NULL);
}
}
......
......@@ -106,6 +106,9 @@ class MessageRendererTest(unittest.TestCase):
renderer.set_compress_mode(MessageRenderer.CASE_SENSITIVE)
self.assertEqual(MessageRenderer.CASE_SENSITIVE,
renderer.get_compress_mode())
renderer.set_compress_mode(MessageRenderer.CASE_INSENSITIVE)
self.assertEqual(MessageRenderer.CASE_INSENSITIVE,
renderer.get_compress_mode())
self.assertRaises(TypeError, renderer.set_compress_mode, "wrong")
if __name__ == '__main__':
......
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