assert shutil.which(binary) is not None
def check_that_tool_does_not_exist(tool, os_id):
+ """
+ validate that the given tool does *not* exist
+ """
assert shutil.which(tool) is None, f"{tool} has been resurrected in the " \
f'{os.getenv("build_system")} build on {os_id}. Please remove skip.'
#!/usr/bin/env python3
+"""
+convert a json file to an html file
+"""
+
import argparse
import json
def main(): # pylint: disable=missing-function-docstring
- parser = argparse.ArgumentParser(description="Converts a json file to a html file")
+ parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("input", type=argparse.FileType("rt"), help="Input file")
parser.add_argument("output", type=argparse.FileType("wt"), help="Output file")
args = parser.parse_args()
+"""
+extension for tweaking Jinja templating environment
+"""
+
import jinja2
def env():
+ """
+ construct a custom Jinja environment for our doc processing
+ """
return jinja2.Environment(
# Load template files from ./templates/
loader=jinja2.PackageLoader(
#!/usr/bin/env python3
+"""
+example usage of Graphviz Python module
+"""
+
import gv # pylint: disable=import-error
g = gv.digraph("G")
out.write("}")
class Result:
+ """
+ outcome of a process’ execution
+ """
+
TIMEOUT = 124
def __init__(self, status: int, runtime: int, rss: Optional[int] = 0):
+"""
+Graphviz miscellaneous test cases
+"""
+
import json
import subprocess
+"""
+Graphviz regression tests
+
+The test cases in this file relate to previously observed bugs. A failure of one
+of these indicates that a past bug has been reintroduced.
+"""
+
import json
import os
from pathlib import Path
+"""
+Graphviz tools tests
+
+The test cases in this file are sanity checks on the various tools in the
+Graphviz suite. A failure of one of these indicates that some basic functional
+property of one of the tools has been broken.
+"""
+
import os
import platform
import re
"vimdot",
])
def test_tools(tool):
+ """
+ check the help/usage output of the given tool looks correct
+ """
if shutil.which(tool) is None:
pytest.skip(f"{tool} not available")
#!/usr/bin/env python3
+"""
+example usage of the Graphviz Python module
+"""
+
import gv # pylint: disable=import-error
-def main():
+def main(): # pylint: disable=missing-function-docstring
# create a new empty graph
G = gv.digraph("G")
# define a simple graph ( A->B )
#!/usr/bin/env python3
+"""
+example usage of the Graphviz Python module
+"""
+
import gv # pylint: disable=import-error
# create a new empty graph
#!/usr/bin/env python3
+"""
+example usage of the Graphviz Python module
+"""
+
import gv # pylint: disable=import-error
g = gv.digraph("G")
+"""
+Graphviz version consistency tests
+"""
+
import os
from pathlib import Path
import subprocess
import pytest
def test_installation():
+ """
+ check that Graphviz reports the expected version number
+ """
+
expected_version = os.environ.get("GV_VERSION")
# If $GV_VERSION is not set, run the CI step that derives it. This will fail