Exemplo n.º 1
0
def test_rule_linenumber(monkeypatch) -> None:
    """Check that SudoRule offense contains a line number."""
    rule = SudoRule()
    lintable = Lintable("", kind="tasks", content=TEST_TASKLIST)
    matches = rule.matchyaml(lintable)
    assert matches[0].linenumber == 5
Exemplo n.º 2
0
def test_rule_linenumber(monkeypatch):
    """Check that SudoRule offense contains a line number."""
    rule = SudoRule()
    matches = rule.matchyaml(dict(path="", type='tasklist'), TEST_TASKLIST)
    assert matches[0].linenumber == 5