| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
""" |
| 7 |
Tests for basic functionality of parser classes. |
| 8 |
""" |
| 9 |
|
| 10 |
from pathlib import Path |
| 11 |
import sys |
| 12 |
import unittest |
| 13 |
|
| 14 |
if __name__ == '__main__': |
| 15 |
|
| 16 |
sys.path.insert(0, Path(__file__).resolve().parents[2].as_posix()) |
| 17 |
|
| 18 |
from docutils import frontend, utils |
| 19 |
import docutils.parsers.rst |
| 20 |
|
| 21 |
|
| 22 |
class RstParserTests(unittest.TestCase): |
| 23 |
|
| 24 |
def test_inputrestrictions(self): |
| 25 |
|
| 26 |
parser = docutils.parsers.rst.Parser() |
| 27 |
document = utils.new_document('test data', |
| 28 |
frontend.get_default_settings(parser)) |
| 29 |
with self.assertRaises(TypeError): |
| 30 |
parser.parse(b'hol', document) |
| 31 |
|
| 32 |
|
| 33 |
if __name__ == '__main__': |
| 34 |
unittest.main() |