| Server IP : 213.136.93.164 / Your IP : 216.73.216.20 Web Server : Apache System : Linux m14200.contabo.net 5.14.0-611.54.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 6 18:03:03 EDT 2026 x86_64 User : ki692510 ( 1047) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib64/python3.9/site-packages/borg/testsuite/ |
Upload File : |
import pytest
from ..nanorst import rst_to_text
def test_inline():
assert rst_to_text('*foo* and ``bar``.') == 'foo and bar.'
def test_inline_spread():
assert rst_to_text('*foo and bar, thusly\nfoobar*.') == 'foo and bar, thusly\nfoobar.'
def test_comment_inline():
assert rst_to_text('Foo and Bar\n.. foo\nbar') == 'Foo and Bar\n.. foo\nbar'
def test_inline_escape():
assert rst_to_text('Such as "\\*" characters.') == 'Such as "*" characters.'
def test_comment():
assert rst_to_text('Foo and Bar\n\n.. foo\nbar') == 'Foo and Bar\n\nbar'
def test_directive_note():
assert rst_to_text('.. note::\n Note this and that') == 'Note:\n Note this and that'
def test_ref():
references = {
'foo': 'baz'
}
assert rst_to_text('See :ref:`fo\no`.', references=references) == 'See baz.'
def test_undefined_ref():
with pytest.raises(ValueError) as exc_info:
rst_to_text('See :ref:`foo`.')
assert 'Undefined reference' in str(exc_info.value)