File: readme_test.py

package info (click to toggle)
pre-commit-hooks 5.0.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 540 kB
  • sloc: python: 3,873; xml: 4; makefile: 2
file content (12 lines) | stat: -rw-r--r-- 375 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
from __future__ import annotations

from pre_commit_hooks.check_yaml import yaml


def test_readme_contains_all_hooks():
    with open('README.md', encoding='UTF-8') as f:
        readme_contents = f.read()
    with open('.pre-commit-hooks.yaml', encoding='UTF-8') as f:
        hooks = yaml.load(f)
    for hook in hooks:
        assert f'`{hook["id"]}`' in readme_contents