Exemplo n.º 1
0
def test_check_links_expansion(sig, expected, sitedata, site):
    mock_subst = mock.Mock()
    mock_subst.return_value = sig.format(**site)
    with mock.patch("sigprobs.evaluate_subst", mock_subst):
        error = sigprobs.check_links(
            "Example", "{{%(subst)s:%(user)s:Example/sig}}" % site, sitedata,
        )
    assert error == expected
    mock_subst.assert_called_once_with(
        "{{%(subst)s:%(user)s:Example/sig}}" % site, sitedata
    )
Exemplo n.º 2
0
def test_check_links_colonuser(sig, expected, sitedata, site):
    error = sigprobs.check_links("(:Example:)", sig.format(**site), sitedata)
    assert error == expected
Exemplo n.º 3
0
def test_check_links(sig, expected, sitedata, site):
    error = sigprobs.check_links("Example", sig.format(**site), sitedata)
    assert error == expected