Return to index

Module rstdoc.traclib.test_wiki_filter


Module test_wiki_filter

Unit Tests for the wiki_filter module.

Imports:
os, os.path, re, sys, unittest, wiki_filter
Methods:
_testFilter(docstring): Filter a docstring for wiki links.
testAll(): Test all, from examples in wiki_fileter
testChgSetEscapes(): This is not a trac changeset: r123. And not this: [123].
testChgSetLinks(): This is a trac changeset: r123 And this: [123].
testLogEscapes(): This is not a trac revision log: r123:456. And not this: [123:456].
testLogLinks(): This is a trac revision log: r123:456. And this: [123:456].
testReportEscapes(): This is not a trac report {123}.
testReportLinks(): This is a trac report {123}.
testSuite():
testTicketEscapes(): This is not a trac ticket #123.
testTicketLinks(): This is a trac ticket #123.
testWikiEscapes(): This is not a wiki link: `aWikiPage This is displayed`.
testWikiLinks(): This is a wiki link: This is displayed.
Attributes:
path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))

Method test_wiki_filter.testAll

Back to test_wiki_filter

Arguments:

Test all, from examples in wiki_fileter

>>> print wikiFilter(wiki_filter.__doc__)
 Convert :wiki:`TracLinks` into :wiki:`RestructuredText` roles.  The
following examples illustrate the use of :wiki:`TracLinks` in
Python :wiki:`DocStrings`.
<BLANKLINE>
    - \`AWikiPage\`: A link to :wiki:`AWikiPage`
    - #1: A link to a ticket :ticket:`1 :ticket:`1 #1``
    - :report:`1 {1}`: A link to a report :report:`1 :report:`1 {1}``
    - :changeset:`1 r1`or :changeset:`1 [1]`: A link to a change set :changeset:`1 :changeset:`1 r1` or :changeset:`1 :changeset:`1 [1]``
    - :log:`1:2 r1:2` or :log:`1:2 [1:2]`: A link to a revision log :log:`1:2 :log:`1:2 r1:2`` or :log:`1:2 :log:`1:2 [1:2]``
    - ``:browser:`trunk/some/file.py source repository```:
      A link to the :browser:`trunk/some/file.py source repository`.
<BLANKLINE>
The preceeding can be escaped by prepending them with a '!' (bang).
Note that change set and log links do not currently work for
the bzr repository backend because they do not use numeric
revisions.
<BLANKLINE>

Method test_wiki_filter.testChgSetEscapes

Back to test_wiki_filter

Arguments:

This is not a trac changeset: r123. And not this: [123].

>>> print _testFilter(testChgSetEscapes.__doc__)
This is not a trac changeset: :changeset:`123 r123`
And not this: :changeset:`123 [123]`.

Method test_wiki_filter.testChgSetLinks

Back to test_wiki_filter

Arguments:

This is a trac changeset: r123 And this: [123].

>>> print _testFilter(testChgSetLinks.__doc__)
This is a trac changeset: :changeset:`123 :changeset:`123 r123`
And this: :changeset:`123 :changeset:`123 [123]``.

Method test_wiki_filter.testLogEscapes

Back to test_wiki_filter

Arguments:

This is not a trac revision log: r123:456. And not this: [123:456].

>>> print _testFilter(testLogEscapes.__doc__)
This is not a trac revision log: :log:`123:456 r123:456`.
And not this: :log:`123:456 [123:456]`.

Method test_wiki_filter.testLogLinks

Back to test_wiki_filter

Arguments:

This is a trac revision log: r123:456. And this: [123:456].

>>> print _testFilter(testLogLinks.__doc__)
This is a trac revision log: :log:`123:456 :log:`123:456 r123:456``.
And this: :log:`123:456 :log:`123:456 [123:456]``.

Method test_wiki_filter.testReportEscapes

Back to test_wiki_filter

Arguments:

This is not a trac report {123}.

>>> print _testFilter(testReportEscapes.__doc__)
This is not a trac report :report:`123 {123}`.

Method test_wiki_filter.testReportLinks

Back to test_wiki_filter

Arguments:

This is a trac report {123}.

>>> print _testFilter(testReportLinks.__doc__)
This is a trac report :report:`123 :report:`123 {123}``.

Method test_wiki_filter.testTicketEscapes

Back to test_wiki_filter

Arguments:

This is not a trac ticket #123.

>>> print _testFilter(testTicketEscapes.__doc__)
This is not a trac ticket :ticket:`123 #123`.

Method test_wiki_filter.testTicketLinks

Back to test_wiki_filter

Arguments:

This is a trac ticket #123.

>>> print _testFilter(testTicketLinks.__doc__)
This is a trac ticket :ticket:`123 :ticket:`123 #123``.

Method test_wiki_filter.testWikiEscapes

Back to test_wiki_filter

Arguments:

This is not a wiki link: `aWikiPage This is displayed`.

>>> print _testFilter(testWikiEscapes.__doc__)
This is not a wiki link: \`aWikiPage This is displayed\`.

Method test_wiki_filter.testWikiLinks

Back to test_wiki_filter

Arguments:

This is a wiki link: This is displayed.

>>> print _testFilter(testWikiLinks.__doc__)
This is a wiki link: :wiki:`aWikiPage This is displayed`.