#! /usr/bin/env python # $Id: test_definition_lists.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger # Copyright: This module has been placed in the public domain. """ Tests for states.py. """ from .__init__ import DocutilsTestSupport def suite(): s = DocutilsTestSupport.ParserTestSuite() s.generateTests(totest) return s totest = {} totest['definition_lists'] = [ ["""\ term definition """, """\ term definition """], ["""\ term definition paragraph """, """\ term definition paragraph """], ["""\ term definition no blank line """, """\ term definition Definition list ends without a blank line; unexpected unindent. no blank line """], ["""\ A paragraph:: A literal block without a blank line first? """, """\ A paragraph:: Blank line missing before literal block (after the "::")? Interpreted as a definition list item. A literal block without a blank line first? """], ["""\ this is not a term; a term may only be one line long this is not a definition """, """\ this is not a term; a term may only be one line long Unexpected indentation. this is not a definition """], ["""\ term 1 definition 1 term 2 definition 2 """, """\ term 1 definition 1 term 2 definition 2 """], ["""\ term 1 definition 1 (no blank line below) term 2 definition 2 """, """\ term 1 definition 1 (no blank line below) term 2 definition 2 """], ["""\ term 1 definition 1 (no blank line below) term 2 definition 2 No blank line after the definition list. """, """\ term 1 definition 1 (no blank line below) term 2 definition 2 Definition list ends without a blank line; unexpected unindent. No blank line after the definition list. """], ["""\ term 1 definition 1 term 1a definition 1a term 1b definition 1b term 2 definition 2 paragraph """, """\ term 1 definition 1 term 1a definition 1a term 1b definition 1b term 2 definition 2 paragraph """], ["""\ Term : classifier The ' : ' indicates a classifier in definition list item terms only. """, """\ Term classifier The ' : ' indicates a classifier in definition list item terms only. """], ["""\ Term: not a classifier Because there's no space before the colon. Term :not a classifier Because there's no space after the colon. Term \: not a classifier Because the colon is escaped. """, """\ Term: not a classifier Because there's no space before the colon. Term :not a classifier Because there's no space after the colon. Term : not a classifier Because the colon is escaped. """], ["""\ ``Term : not a classifier`` Because the ' : ' is inside an inline literal. """, """\ Term : not a classifier Because the ' : ' is inside an inline literal. """], ["""\ Term `with *inline ``text **errors : classifier `with *errors ``too Definition `with *inline ``text **markup errors. """, """\ Term \n\ ` with \n\ * inline \n\ `` text \n\ ** errors classifier \n\ ` with \n\ * errors \n\ `` too Inline interpreted text or phrase reference start-string without end-string. Inline emphasis start-string without end-string. Inline literal start-string without end-string. Inline strong start-string without end-string. Inline interpreted text or phrase reference start-string without end-string. Inline emphasis start-string without end-string. Inline literal start-string without end-string. Definition \n\ ` with \n\ * inline \n\ `` text \n\ ** markup errors. Inline interpreted text or phrase reference start-string without end-string. Inline emphasis start-string without end-string. Inline literal start-string without end-string. Inline strong start-string without end-string. """], ["""\ Term : classifier one : classifier two Definition """, """\ Term classifier one classifier two Definition """], ] if __name__ == '__main__': import unittest unittest.main(defaultTest='suite')