buildtest.cli

buildtest cli: include functions to build, get test configurations, and interact with a global configuration for buildtest.

Package Contents

Functions

handle_kv_string(val)

This method is used as type field in --filter argument in buildtest buildspec find.

positive_number(value)

Checks if input is positive number and returns value as an int type.

supported_color(input_color)

Checks if input is a supported color and returns value as an Color type.

valid_time(value)

Checks if input is valid time and returns value as a str type.

get_parser()

misc_menu(subparsers)

Build the command line menu for some miscellaneous commands

stylecheck_menu(subparsers)

This method will create command options for buildtest stylecheck

unittest_menu(subparsers)

This method builds the command line menu for buildtest unittests command

tutorial_examples_menu(subparsers)

This method builds the command line menu for buildtest tutorial-examples command

path_menu(subparsers)

This method builds the command line menu for buildtest path command

history_menu(subparsers, parent_parser)

This method builds the command line menu for buildtest history command

build_menu(subparsers)

This method implements command line menu for buildtest build command.

buildspec_menu(subparsers, parent_parser)

This method implements buildtest buildspec command

config_menu(subparsers, parent_parser)

This method adds argparse argument for buildtest config

report_menu(subparsers, parent_parser)

This method implements the buildtest report command options

inspect_menu(subparsers, parent_parser)

This method builds argument for buildtest inspect command

schema_menu(subparsers)

This method builds menu for buildtest schema

cdash_menu(subparsers)

This method builds arguments for buildtest cdash command.

Attributes

BUILDTEST_COPYRIGHT

BUILDTEST_VERSION

console

schema_table

buildtest.cli.BUILDTEST_VERSION = '1.3'
buildtest.cli.console
buildtest.cli.schema_table
buildtest.cli.handle_kv_string(val)[source]

This method is used as type field in –filter argument in buildtest buildspec find. This method returns a dict of key,value pair where input is in format key1=val1,key2=val2,key3=val3

Parameters

val (str) – Input string in key1=value1,key2=value2 format that is processed into a dictionary type

Returns

A dict mapping of key=value pairs

Return type

dict

buildtest.cli.positive_number(value)[source]

Checks if input is positive number and returns value as an int type.

Parameters

value (str or int) – Specify an input number

Returns

Return value as int type

Return type

int

Raises

argparse.ArgumentTypeError will be raised if input is not positive number or input is not str or int type

>>> positive_number("1")
1
>>> positive_number(2)
2
buildtest.cli.supported_color(input_color)[source]

Checks if input is a supported color and returns value as an Color type.

Parameters

input_color (str) – Specify an input color

Returns

Return value as rich.color.Color type

Return type

str

Raises

argparse.ArgumentTypeError will be raised if input is not a supported color input or is not str type

>>> supported_color("red")
red
buildtest.cli.valid_time(value)[source]

Checks if input is valid time and returns value as a str type.

Parameters

value (str) – Specify an input date in yyyy-mm-dd format

Returns

Return value as str type in correct format

Return type

int

Raises

argparse.ArgumentTypeError will be raised if input is not str or input is not in desired format

>>> valid_time("2022-01-01")
"2022-01-01"
>>> valid_time("2022-01-13")
"2022-01-13"
buildtest.cli.get_parser()[source]
buildtest.cli.misc_menu(subparsers)[source]

Build the command line menu for some miscellaneous commands

Parameters

subparsers (argparse._SubParsersAction) – Subparser object to add subparser

buildtest.cli.stylecheck_menu(subparsers)[source]

This method will create command options for buildtest stylecheck

Parameters

subparsers (argparse._SubParsersAction) – Subparser object to add subparser

buildtest.cli.unittest_menu(subparsers)[source]

This method builds the command line menu for buildtest unittests command

Parameters

subparsers (argparse._SubParsersAction) – Subparser object to add subparser

buildtest.cli.tutorial_examples_menu(subparsers)[source]

This method builds the command line menu for buildtest tutorial-examples command

Parameters

subparsers (argparse._SubParsersAction) – Subparser object to add subparser

buildtest.cli.path_menu(subparsers)[source]

This method builds the command line menu for buildtest path command

Parameters

subparsers (argparse._SubParsersAction) – Subparser object to add subparser

buildtest.cli.history_menu(subparsers, parent_parser)[source]

This method builds the command line menu for buildtest history command

Parameters
  • subparsers (argparse._SubParsersAction) – Subparser object to add subparser

  • parent_parser (argparse.ArgumentParser) – Parent parser object to add to subparser

buildtest.cli.build_menu(subparsers)[source]

This method implements command line menu for buildtest build command.

Parameters

subparsers (argparse._SubParsersAction) – Subparser object to add subparser

buildtest.cli.buildspec_menu(subparsers, parent_parser)[source]

This method implements buildtest buildspec command

Parameters
  • subparsers (argparse._SubParsersAction) – Subparser object

  • parent_parser (argparse.ArgumentParser) – Parent parser object

buildtest.cli.config_menu(subparsers, parent_parser)[source]

This method adds argparse argument for buildtest config

Parameters
  • subparsers (argparse._SubParsersAction) – Subparser object

  • parent_parser (argparse.ArgumentParser) – Parent parser object

buildtest.cli.report_menu(subparsers, parent_parser)[source]

This method implements the buildtest report command options

Parameters
  • subparsers (argparse._SubParsersAction) – Subparser object

  • parent_parser (argparse.ArgumentParser) – Parent parser object

buildtest.cli.inspect_menu(subparsers, parent_parser)[source]

This method builds argument for buildtest inspect command

Parameters
  • subparsers (argparse._SubParsersAction) – Subparser object

  • parent_parser (argparse.ArgumentParser) – Parent parser object

buildtest.cli.schema_menu(subparsers)[source]

This method builds menu for buildtest schema

Parameters

subparsers (argparse._SubParsersAction) – Subparser object

buildtest.cli.cdash_menu(subparsers)[source]

This method builds arguments for buildtest cdash command.

Parameters

subparsers (argparse._SubParsersAction) – Subparser object