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")
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')
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
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
def test_transform_with_title_template(doctree):
    """
    Test transformation with title template.
    """
    pytest.assert_issue_pending_xref(doctree, "10", "{issue.title} (#{issue.id})")
def test_transform_simple(doctree):
    """
    Test a simple transform with just an issue id.
    """
    pytest.assert_issue_pending_xref(doctree, "10", "#10")
Esempio n. 7
0
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')
Esempio n. 8
0
def test_with_title(doctree, issue):
    """
    Test role with an explicit title.
    """
    pytest.assert_issue_pending_xref(doctree, '10', 'foo')
Esempio n. 9
0
def test_simple(doctree, issue):
    """
    Test simple usage of the role.
    """
    pytest.assert_issue_pending_xref(doctree, '10', '10')
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
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
def test_transform_with_title_template(doctree):
    """
    Test transformation with title template.
    """
    pytest.assert_issue_pending_xref(doctree, '10',
                                     '{issue.title} (#{issue.id})')
def test_transform_simple(doctree):
    """
    Test a simple transform with just an issue id.
    """
    pytest.assert_issue_pending_xref(doctree, '10', '#10')
Esempio n. 14
0
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")
Esempio n. 15
0
def test_with_title(doctree, issue):
    """
    Test role with an explicit title.
    """
    pytest.assert_issue_pending_xref(doctree, "10", "foo")
Esempio n. 16
0
def test_simple(doctree, issue):
    """
    Test simple usage of the role.
    """
    pytest.assert_issue_pending_xref(doctree, "10", "10")