Add a new file to hold generic utilities for the functional tests. As part of this change, a function that can indent a block of text has been added.
Signed-off-by: Tom Hromatka <tom.hroma...@oracle.com> --- ftests/utils.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ftests/utils.py diff --git a/ftests/utils.py b/ftests/utils.py new file mode 100644 index 000000000000..47a63e5caa82 --- /dev/null +++ b/ftests/utils.py @@ -0,0 +1,25 @@ +# +# Utility functions for the libcgroup functional tests +# +# Copyright (c) 2020 Oracle and/or its affiliates. +# Author: Tom Hromatka <tom.hroma...@oracle.com> +# + +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of version 2.1 of the GNU Lesser General Public License as +# published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License +# for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, see <http://www.gnu.org/licenses>. +# + +# function to indent a block of text by cnt number of spaces +def indent(in_str, cnt): + leading_indent = cnt * ' ' + return ''.join(leading_indent + line for line in in_str.splitlines(True)) -- 2.25.4 _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel