tbottest.initconfighelper
libhelper functions
- tbottest.initconfighelper.inifile_get_tbotfilename()[source]
returns the path of the copy of tbot.ini this run uses
The file is the one of the tbot flag inifile:<path>, relative to get_tbotconfig_path() or absolute, else the template tbottest/tbotconfig/BOARDNAME/tbot.ini. tbot copies it on the first call, to <file>-<id> or, with the flag tmpfilepath:<dir>, into <dir> (id from get_unique_filename_extension()), and works on the copy; set_board_cfg() of boardspecific.py replaces the placeholders there. A .json file is not copied, its path is returned, see config_is_json().
- tbottest.initconfighelper.inifile_get_tbotboardfilename()[source]
returns the path of the copy of the board ini this run uses
As inifile_get_tbotfilename(), with the tbot flag boardfile:<path> and the template tbottest/tbotconfig/BOARDNAME/BOARDNAME.ini.
- tbottest.initconfighelper.get_tbotconfig_path()[source]
returns the directory relative paths of the ini files start from
The environment variable TBOTCONFIGPATH, else the first entry of PYTHONPATH that contains “tbotconfig”, with “tbotconfig” removed, else the current directory. Decided on the first call.
- tbottest.initconfighelper.get_unique_filename_extension()[source]
returns the extension of the copies of the ini files of this run
A random uuid4 string, made on the first call; tbot.ini and the board ini of one run get the same one.
- tbottest.initconfighelper.get_lab_sectionname() str[source]
returns the name of the section of the lab host in tbot.ini
LABHOST_<name> with the tbot flag labname:<name>, else LABHOST.
- tbottest.initconfighelper.get_tbot_flags()[source]
returns the tbot flags the ini files are set up with
The flags of the command line (get_tbot_arguments()), or tbot.flags if sys.argv contains –usetbotflags, as Documentation/conf.py sets it for the documentation build.
- tbottest.initconfighelper.get_tbot_arguments()[source]
get the arguments with which tbot is called
Parses sys.argv with the argument parser of tbot (tbot.newbot.build_parser()), plus the options –complete-module and –complete-testcase of the shell completion, which also suppress the output of tbot. Under sphinx-build no arguments are parsed, under pytest only the argument files (@<file>).
- Returns:
the parsed arguments (argparse.Namespace)
- tbottest.initconfighelper.config_is_json() bool[source]
returns True if the configuration of this run is JSON
That is, if the file of the tbot flag inifile:<path> ends in .json. Then tbot reads it and the file of boardfile:<path>, which has to be JSON as well, directly: no copies, no placeholders, and no boardspecific.py.