Table of Contents

Class: ActionChecker ./src/peak/ddt/processors.py

Test a domain object using a "script" of actions

This ModelChecker subclass reads actions from a table with three or more columns. The first cell in each row is a "command", such as "start", "enter", "press", or "check", that is used to look up a method on the action processor itself. The invoked method can then use the remaining cells from the row to obtain its arguments. See the docs for the start, enter, press, and check methods for more details.

Note that tables used with ActionChecker must not include column headings, as ActionChecker does not parse them. (As a result, it also has no need for a columnSuffix attribute or parseHeader() method.)

Unlike ModelChecker, ActionChecker should not be given a specific targetClass to use. Instead, the start command is used to create an instance of a specified class, which is then used until another start command is executed. Also, ActionChecker does not use the columnSuffixes attribute, because it does not parse column headings.

Base Classes   
ModelChecker
Methods   
check
enter
getCommand
mapCell
press
processRow
processRows
start
  check 
check ( self,  cells )

Look up a field name, and check if value matches

  enter 
enter ( self,  cells )

Look up a field name, and then set it to value

  getCommand 
getCommand ( self,  text )

Lookup text as a method of this processor

You can override this if you want to use a different strategy for obtaining commands. The returned command must be a callable that takes one parameter: a list of cells. The cells the command receives will be the remainder of the row that contained the command; typically this means row.cells[1:].

  mapCell 
mapCell (
        self,
        mapperCell,
        mappedCell,
        mapMethod,
        )

Convenience method for two-argument mapping commands

  press 
press ( self,  cells )

Invoke specified method/button/whatever

  processRow 
processRow (
        self,
        row,
        rows,
        )

Process a row using self.getCommand(firstCell.text)(otherCells)

  processRows 
processRows ( self,  rows )

Just process rows; no column headings are required or wanted.

  start 
start ( self,  cells )

Obtain an instance of the specified type and use it from here on


Table of Contents

This document was automatically generated on Mon Apr 22 01:11:05 2024 by HappyDoc version 2.1