#! /usr/bin/env python # Author: David Goodger # Contact: goodger@users.sourceforge.net # Revision: $Revision: 3129 $ # Date: $Date: 2005-03-26 17:21:28 +0100 (Sat, 26 Mar 2005) $ # Copyright: This module has been placed in the public domain. """ Tests for RFC-2822 headers in PEPs (readers/pep.py). """ from __init__ import DocutilsTestSupport def suite(): s = DocutilsTestSupport.PEPParserTestSuite() s.generateTests(totest) return s totest = {} totest['rfc2822'] = [ ["""\ Author: Me Version: 1 Date: 2002-04-23 """, """\ Author Me Version 1 Date 2002-04-23 """], ["""\ Author: Me Version: 1 Date: 2002-04-23 .. Leading blank lines don't affect RFC-2822 header parsing. """, """\ Author Me Version 1 Date 2002-04-23 Leading blank lines don't affect RFC-2822 header parsing. """], ["""\ .. A comment should prevent RFC-2822 header parsing. Author: Me Version: 1 Date: 2002-04-23 """, """\ A comment should prevent RFC-2822 header parsing. Author: Me Version: 1 Date: 2002-04-23 """], ["""\ Author: Me Version: 1 Date: 2002-04-23 """, """\ Author Me Version: 1 Date: 2002-04-23 """], ["""\ field: empty item above, no blank line """, """\ field RFC2822-style field list ends without a blank line; unexpected unindent. empty item above, no blank line """], ["""\ Author: Me Version: 1 Date: 2002-04-23 """, """\ Author Me Version 1 Date 2002-04-23 """], ["""\ Authors: Me, Myself, and I Version: 1 or so Date: 2002-04-23 (Tuesday) """, """\ Authors Me, Myself, and I Version 1 or so Date 2002-04-23 (Tuesday) """], ["""\ Authors: Me, Myself, and I Version: 1 or so Date: 2002-04-23 (Tuesday) """, """\ Authors Me, Myself, and I Version 1 or so Date 2002-04-23 (Tuesday) """], ["""\ Authors: - Me - Myself - I Version: """, """\ Authors Me Myself I Version """], ["""\ Authors: Me Myself and I Version: """, """\ Authors Me Myself and I Block quote ends without a blank line; unexpected unindent. Version: """], ] if __name__ == '__main__': import unittest unittest.main(defaultTest='suite')