Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
#! /usr/bin/env python
# $Id: test_docinfo.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger
# Copyright: This module has been placed in the public domain.
"""
Tests for docutils.transforms.frontmatter.DocInfo.
"""
from __init__ import DocutilsTestSupport
from docutils.transforms.frontmatter import DocInfo
from docutils.parsers.rst import Parser
def suite():
parser = Parser()
s = DocutilsTestSupport.TransformTestSuite(parser)
s.generateTests(totest)
return s
totest = {}
totest['bibliographic_field_lists'] = ((DocInfo,), [
["""\
.. Bibliographic element extraction.
:Abstract:
There can only be one abstract.
It is automatically moved to the end of the other bibliographic elements.
:Author: Me
:Version: 1
:Date: 2001-08-11
:Parameter i: integer
""",
"""\
Me
1
2001-08-11
Parameter i
integer
Abstract
There can only be one abstract.
It is automatically moved to the end of the other bibliographic elements.
Bibliographic element extraction.
"""],
["""\
.. Bibliographic element extraction.
:Abstract: Abstract 1.
:Author: Me
:Address: 123 My Street
Example, EX
:Contact: me@my.org
:Version: 1
:Abstract: Abstract 2 (should generate a warning).
:Date: 2001-08-11
:Parameter i: integer
""",
"""\
Me
123 My Street
Example, EX
me@my.org
1
Abstract
Abstract 2 (should generate a warning).
There can only be one "Abstract" field.
2001-08-11
Parameter i
integer
Abstract
Abstract 1.
Bibliographic element extraction.
"""],
["""\
:Author: - must be a paragraph
:Status: a *simple* paragraph
:Date: But only one
paragraph.
:Version:
.. and not empty either
""",
"""\
Author
must be a paragraph
Cannot extract bibliographic field "Author" containing anything other than a single paragraph.
a \n\
simple
paragraph
Date
But only one
paragraph.
Cannot extract compound bibliographic field "Date".
Version
Cannot extract empty bibliographic field "Version".
and not empty either
"""],
["""\
:Authors: Me, Myself, **I**
:Authors: PacMan; Ms. PacMan; PacMan, Jr.
:Authors:
Here
There
*Everywhere*
:Authors: - First
- Second
- Third
""",
"""\
Me
Myself
I
PacMan
Ms. PacMan
PacMan, Jr.
Here
There
Everywhere
First
Second
Third
"""],
["""\
:Authors: Only One
:Authors: One, Only;
""",
"""\
Only One
One, Only
"""],
["""\
:Authors:
:Authors: 1. One
2. Two
:Authors:
-
-
:Authors:
- One
Two
:Authors:
- One
Two
""",
"""\
Authors
Cannot extract empty bibliographic field "Authors".
Authors
One
Two
Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item.
Authors
Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item.
Authors
One
Two
Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item.
Authors
One
Two
Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item.
"""],
["""\
.. RCS keyword extraction.
:Status: (some text) $""" + """RCSfile: test_docinfo.py,v $ (more text)
:Date: (some text) $""" + """Date: 2002/10/08 01:34:23 $ (more text)
:Date: (some text) $""" + """Date: 2005-03-26T16:21:28.693201Z $ (more text)
:Version: (some text) $""" + """Revision: 1.1 $ (more text)
""",
"""\
(some text) test_docinfo.py (more text)
(some text) 2002-10-08 (more text)
(some text) 2005-03-26 (more text)
(some text) 1.1 (more text)
RCS keyword extraction.
"""],
])
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')