Update readme fixture checker and readme (#699)

This commit is contained in:
Teemu R
2024-01-24 09:36:45 +01:00
committed by GitHub
parent eb217a748c
commit 3f40410db3
2 changed files with 7 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
"""Script that checks if README.md is missing devices that have fixtures."""
import re
import sys
from kasa.tests.conftest import (
@@ -32,10 +33,11 @@ def _get_device_type(dev, typemap):
found_unlisted = False
for dev in ALL_DEVICES:
if dev not in readme:
regex = rf"^\*.*\s{dev}"
match = re.search(regex, readme, re.MULTILINE)
if match is None:
print(f"{dev} not listed in {_get_device_type(dev, typemap)}")
found_unlisted = True
if found_unlisted:
sys.exit(-1)