check_usage.py 346 Bytes
Newer Older
Zachary Snow committed
1 2 3 4 5 6 7 8 9 10
import subprocess

with open("../../README.md", "r") as file:
    text_readme = file.read()

text_help = subprocess.check_output(["../../bin/sv2v", "--help"]).decode()
text_usage = "```\n" + "\n".join(text_help.split("\n")[2:-5]) + "\n```"

if text_usage not in text_readme:
    raise RuntimeError(f"'{text_usage}' not found in '{text_readme}'")