diff --git a/tests/dot_usage_info.txt b/tests/dot_usage_info.txt new file mode 100644 index 0000000000000000000000000000000000000000..bb9598522b9344a90fd2bc9b5b8759ea7ee88262 --- /dev/null +++ b/tests/dot_usage_info.txt @@ -0,0 +1,33 @@ +Usage: dot [-Vv?] [-(GNE)name=val] [-(KTlso)] +(additional options for neato) [-x] [-n] +(additional options for fdp) [-L(gO)] [-L(nUCT)] +(additional options for config) [-cv] + + -V - Print version and exit + -v - Enable verbose mode + -Gname=val - Set graph attribute 'name' to 'val' + -Nname=val - Set node attribute 'name' to 'val' + -Ename=val - Set edge attribute 'name' to 'val' + -Tv - Set output format to 'v' + -Kv - Set layout engine to 'v' (overrides default based on command name) + -lv - Use external library 'v' + -ofile - Write output to 'file' + -O - Automatically generate an output filename based on the input filename with a .'format' appended. (Causes all -ofile options to be ignored.) + -P - Internally generate a graph of the current plugins. + -q[l] - Set level of message suppression (=1) + -s[v] - Scale input by 'v' (=72) + -y - Invert y coordinate in output + + -n[v] - No layout mode 'v' (=1) + -x - Reduce graph + + -Lg - Don't use grid + -LO - Use old attractive force + -Ln - Set number of iterations to i + -LU - Set unscaled factor to i + -LC - Set overlap expansion factor to v + -LT[*] - Set temperature (temperature factor) to v + + -c - Configure plugins (Writes $prefix/lib/graphviz/config + with available plugin information. Needs write privilege.) + -? - Print usage and exit diff --git a/tests/test_regression.py b/tests/test_regression.py index 65c0499f5bbe3e2bb6ed1d72b395a878352d8ccf..ba61f3b253205d8220970b49313ee84f7bff617e 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -39,6 +39,10 @@ from gvtest import ( # pylint: disable=wrong-import-position which, ) +usage_path = Path(__file__).parent / "dot_usage_info.txt" +with open(usage_path, "rt", encoding="utf-8") as usage_file: + dot_usage_info = usage_file.read() + def is_ndebug_defined() -> bool: """ @@ -3375,43 +3379,6 @@ def test_gvpr_printf(statement: str, expected: str): assert result == expected, "incorrect GVPR printf behavior" -usage_info = """\ -Usage: dot [-Vv?] [-(GNE)name=val] [-(KTlso)] -(additional options for neato) [-x] [-n] -(additional options for fdp) [-L(gO)] [-L(nUCT)] -(additional options for config) [-cv] - - -V - Print version and exit - -v - Enable verbose mode - -Gname=val - Set graph attribute 'name' to 'val' - -Nname=val - Set node attribute 'name' to 'val' - -Ename=val - Set edge attribute 'name' to 'val' - -Tv - Set output format to 'v' - -Kv - Set layout engine to 'v' (overrides default based on command name) - -lv - Use external library 'v' - -ofile - Write output to 'file' - -O - Automatically generate an output filename based on the input filename with a .'format' appended. (Causes all -ofile options to be ignored.) - -P - Internally generate a graph of the current plugins. - -q[l] - Set level of message suppression (=1) - -s[v] - Scale input by 'v' (=72) - -y - Invert y coordinate in output - - -n[v] - No layout mode 'v' (=1) - -x - Reduce graph - - -Lg - Don't use grid - -LO - Use old attractive force - -Ln - Set number of iterations to i - -LU - Set unscaled factor to i - -LC - Set overlap expansion factor to v - -LT[*] - Set temperature (temperature factor) to v - - -c - Configure plugins (Writes $prefix/lib/graphviz/config - with available plugin information. Needs write privilege.) - -? - Print usage and exit -""" - - def test_dot_questionmarkV(): """ test the output from two short options combined @@ -3422,7 +3389,7 @@ def test_dot_questionmarkV(): universal_newlines=True, ) - assert out == usage_info, "unexpected usage info" + assert out == dot_usage_info, "unexpected usage info" def test_dot_randomV(): @@ -3430,7 +3397,7 @@ def test_dot_randomV(): test the output from a malformed command """ - expected = f"Error: dot: option -r unrecognized\n\n{usage_info}" + expected = f"Error: dot: option -r unrecognized\n\n{dot_usage_info}" proc = subprocess.run( ["dot", "-randomV"],