mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 20:38:54 +00:00
Improve readme test
This commit is contained in:
parent
ee610032b8
commit
c6171a85e9
@ -2,18 +2,16 @@ from pathlib import Path
|
|||||||
|
|
||||||
|
|
||||||
def test_readme():
|
def test_readme():
|
||||||
with open('README.md') as f:
|
project_root = Path(__file__).parent.parent
|
||||||
|
with project_root.joinpath('README.md').open() as f:
|
||||||
readme = f.read()
|
readme = f.read()
|
||||||
|
|
||||||
bundled = Path(__file__).parent.parent \
|
bundled = project_root \
|
||||||
.joinpath('thefuck') \
|
.joinpath('thefuck') \
|
||||||
.joinpath('rules') \
|
.joinpath('rules') \
|
||||||
.glob('*.py')
|
.glob('*.py')
|
||||||
|
|
||||||
for rule in bundled:
|
for rule in bundled:
|
||||||
if rule.stem != '__init__' and rule.stem not in readme:
|
if rule.stem != '__init__':
|
||||||
raise Exception('Missing rule "{}" in README.md'.format(rule.stem))
|
assert rule.stem in readme,\
|
||||||
|
'Missing rule "{}" in README.md'.format(rule.stem)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
test_readme()
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user