コード例 #1
0
def test_transform_inline_markup(doctree):
    """
    Test that issue ids inside inline markup like emphasis are transformed.
    """
    emphasis = doctree.next_node(nodes.emphasis)
    assert emphasis
    pytest.assert_issue_pending_xref(emphasis, "10", "#10")
    strong = doctree.next_node(nodes.strong)
    assert strong
    pytest.assert_issue_pending_xref(strong, "10", "#10")
コード例 #2
0
def test_transform_inline_markup(doctree):
    """
    Test that issue ids inside inline markup like emphasis are transformed.
    """
    emphasis = doctree.next_node(nodes.emphasis)
    assert emphasis
    pytest.assert_issue_pending_xref(emphasis, '10', '#10')
    strong = doctree.next_node(nodes.strong)
    assert strong
    pytest.assert_issue_pending_xref(strong, '10', '#10')
コード例 #3
0
def test_transform_non_ascii(doctree, content):
    """
    Test transformation with non-ascii characters.
    """
    pytest.assert_issue_pending_xref(doctree, "10", "#10")
    assert doctree.astext() == content
コード例 #4
0
def test_transform_leading_and_trailing_text(doctree, content):
    """
    Test that transformation leaves leading and trailing text intact.
    """
    pytest.assert_issue_pending_xref(doctree, "10", "#10")
    assert doctree.astext() == content
コード例 #5
0
def test_transform_with_title_template(doctree):
    """
    Test transformation with title template.
    """
    pytest.assert_issue_pending_xref(doctree, "10", "{issue.title} (#{issue.id})")
コード例 #6
0
def test_transform_simple(doctree):
    """
    Test a simple transform with just an issue id.
    """
    pytest.assert_issue_pending_xref(doctree, "10", "#10")
コード例 #7
0
ファイル: test_role.py プロジェクト: torcolvin/sphinx-contrib
def test_without_plaintext_issues(doctree, issue):
    """
    Test that the role still works even if plaintext issues are disabled.
    """
    pytest.assert_issue_pending_xref(doctree, '10', '10')
コード例 #8
0
ファイル: test_role.py プロジェクト: torcolvin/sphinx-contrib
def test_with_title(doctree, issue):
    """
    Test role with an explicit title.
    """
    pytest.assert_issue_pending_xref(doctree, '10', 'foo')
コード例 #9
0
ファイル: test_role.py プロジェクト: torcolvin/sphinx-contrib
def test_simple(doctree, issue):
    """
    Test simple usage of the role.
    """
    pytest.assert_issue_pending_xref(doctree, '10', '10')
コード例 #10
0
def test_transform_leading_and_trailing_text(doctree, content):
    """
    Test that transformation leaves leading and trailing text intact.
    """
    pytest.assert_issue_pending_xref(doctree, '10', '#10')
    assert doctree.astext() == content
コード例 #11
0
def test_transform_non_ascii(doctree, content):
    """
    Test transformation with non-ascii characters.
    """
    pytest.assert_issue_pending_xref(doctree, '10', '#10')
    assert doctree.astext() == content
コード例 #12
0
def test_transform_with_title_template(doctree):
    """
    Test transformation with title template.
    """
    pytest.assert_issue_pending_xref(doctree, '10',
                                     '{issue.title} (#{issue.id})')
コード例 #13
0
def test_transform_simple(doctree):
    """
    Test a simple transform with just an issue id.
    """
    pytest.assert_issue_pending_xref(doctree, '10', '#10')
コード例 #14
0
ファイル: test_role.py プロジェクト: torcolvin/sphinx-contrib
def test_without_plaintext_issues(doctree, issue):
    """
    Test that the role still works even if plaintext issues are disabled.
    """
    pytest.assert_issue_pending_xref(doctree, "10", "10")
コード例 #15
0
ファイル: test_role.py プロジェクト: torcolvin/sphinx-contrib
def test_with_title(doctree, issue):
    """
    Test role with an explicit title.
    """
    pytest.assert_issue_pending_xref(doctree, "10", "foo")
コード例 #16
0
ファイル: test_role.py プロジェクト: torcolvin/sphinx-contrib
def test_simple(doctree, issue):
    """
    Test simple usage of the role.
    """
    pytest.assert_issue_pending_xref(doctree, "10", "10")