def METHOD_NAME(
    default_rules_collection: RulesCollection,
    file: str,
    expected: int,
) -> None:
    """Validate that rule works as intended."""
    results = Runner(file, rules=default_rules_collection).run()
    for result in results:
        assert result.rule.id == CommandsInsteadOfModulesRule.id, result
    assert len(results) == expected