gridtest package¶
Subpackages¶
Submodules¶
gridtest.decorators module¶
Copyright (C) 2020 Vanessa Sochat.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
gridtest.func are short functions that serve as helpers for a gridtest. Any function in here can be referenced as {% func_name %} or with arguments {% func_name arg1=1 arg2=2 %}. If you possibly have a namespace conflict, you can also reference {% gridtest.func.func_name %} and it will work to reference the function here.
gridtest.defaults module¶
Copyright (C) 2020 Vanessa Sochat.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
gridtest.defaults.
getenv
(variable_key, default=None, required=False, silent=True)[source]¶ attempt to get an environment variable. If the variable is not found, None is returned.
Arguments:
variable_key (str) : the variable name
required (bool) : exit with error if not found
silent (bool) : Do not print debugging information
gridtest.func module¶
Copyright (C) 2020 Vanessa Sochat.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
gridtest.func are short functions that serve as helpers for a gridtest. Any function in here can be referenced as {% func_name %} or with arguments {% func_name arg1=1 arg2=2 %}. If you possibly have a namespace conflict, you can also reference {% gridtest.func.func_name %} and it will work to reference the function here.
-
gridtest.func.
tmp_dir
(requested_tmpdir=None, prefix='', create=True)[source]¶ get a temporary directory for an operation. Default creates it.
- Arguments:
prefix (str) : prefix the filename with this string.
requested_tmpdir (str) : an optional requested temporary directory
create (bool) : create the temporary directory
-
gridtest.func.
tmp_path
(requested_tmpdir=None, prefix='', create=False, ext='')[source]¶ get a temporary file with an optional prefix. By default will be created in /tmp, and the file is closed (and just a name returned).
- Arguments:
requested_tmpdir (str) : an optional requested temporary directory
prefix (str) : prefix the filename with this string.
create (bool) : create the file (empty) defaults to False
ext (str) : the extension to use, should include .
gridtest.utils module¶
Copyright (C) 2020 Vanessa Sochat.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
gridtest.utils.
read_file
(filename, readlines=True)[source]¶ write_file will open a file, “filename” and write content and properly close the file.
- Arguments:
filename (str) : the filename to read
readlines (bool) : read lines of the file (vs all raw)
-
gridtest.utils.
read_yaml
(filename)[source]¶ read a yaml file, only including sections between dashes
- Arguments:
filename (str) : the filename to read
-
gridtest.utils.
recursive_find
(base, pattern='*.py')[source]¶ recursive find will yield python files in all directory levels below a base path.
- Arguments:
base (str) : the base directory to search
pattern: a pattern to match, defaults to *.py
gridtest.version module¶
Copyright (C) 2020 Vanessa Sochat.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
Module contents¶
Copyright (C) 2020 Vanessa Sochat.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.