bugscpp.processor.test.TestCommandScript

class TestCommandScript(case: int, command_type: taxonomy.taxonomy.CommandType, command: List[str])[source]

Bases: processor.core.command.DockerCommandScript, bugscpp.processor.test.CapturedOutputAttributeMixin

Script to execute test.

__init__(case: int, command_type: taxonomy.taxonomy.CommandType, command: List[str])[source]

Methods

__init__(case, command_type, command)

after()

Invoked after script is executed.

before()

Invoked before script is executed.

output(linenr, exit_code, output)

Invoked after each line is executed.

should_be_run_at_once()

returns

Return true if it should be written to a file and executed at once,

step(linenr, line)

Invoked before each line is executed.

Attributes

captured_output

case

after()[source]

Invoked after script is executed.

before()[source]

Invoked before script is executed.

output(linenr: Optional[int], exit_code: int, output: str)[source]

Invoked after each line is executed. linenr is None if all commands are executed as if it is a script.

Parameters
  • linenr (Optional[int]) – Index of the commands which has been executed. None if the type is CommandType.Script.

  • exit_code (Optional[int]) – Exit code of the executed command. None when stream is set to False.

  • output (str) – Captured stdout of the executed command.

should_be_run_at_once() bool
Returns

Return true if it should be written to a file and executed at once, otherwise if it is sent to a container line by line.

Return type

bool

step(linenr: int, line: str)[source]

Invoked before each line is executed.

Parameters
  • linenr (int) – The current line number.

  • line (str) – The current line to execute.