Permalink
Browse files

add testcase for decoding empty headers

  • Loading branch information...
1 parent 47be079 commit 58bf12257466d6f3bc513f4ddc01d702d3c68752 @flaviogrossi committed Jul 17, 2014
Showing with 7 additions and 0 deletions.
  1. +7 −0 tests/test_codec.py
View
@@ -133,6 +133,13 @@ def test_chunked_messages(self):
self.assertEquals(decoded[0],
MilterMessage('SMFIC_BODY', dict(buf='mybody')))
+ def test_smfic_header_decode_with_empty_value(self):
+ # test SMFIC_HEADER decoding when header has an empty value
+ msg = MilterMessage('SMFIC_HEADER', dict(name='to', value=''))
+ encoded = '\x00\x00\x00\x05Lto\x00\x00'
+ self.decoder.feed(encoded)
+ self.assertEquals(next(self.decoder.decode()), msg)
+
class MilterEncoderTest(MilterCodecTest):
def setUp(self):

0 comments on commit 58bf122

Please sign in to comment.