Refactored ReSTDirective.handle_signature() and added the first tests for rst domain.

This commit is contained in:
Leontius Adhika Pradhana
2010-04-16 17:51:19 +08:00
parent 24cc2fd09c
commit 7a3ac740da
2 changed files with 43 additions and 10 deletions

26
tests/test_rst_domain.py Normal file
View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
"""
test_rst_domain
~~~~~~~~~~~~~~~
Tests the reStructuredText domain.
:copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from sphinx.domains.rst import parse_directive
def test_parse_directive():
s = parse_directive(' foö ')
assert s == ('foö', '')
s = parse_directive(' .. foö :: ')
assert s == ('foö', '')
s = parse_directive('.. foö:: args1 args2')
assert s == ('foö', 'args1 args2')
s = parse_directive('.. :: bar')
assert s == ('.. :: bar', '')