glusto.carteplex module

Cartesian product decorator class for on-the-fly creation of testcases based on a matrix of lists.

  • Handles automatic generation of cartesian product combinations based on any
    number of lists.
  • Provides an ‘ALL’ default to populate a var with a predefined full list.
  • Compares variables passed in decorator to a list of configuration options
    (e.g., specify what underlying configuration is available to the test via config file and specify the configurations the test is limited to… Glusto will only create the possible combinations based on the intersection).
  • Passes “axis names” into test class as class attributes to make them
    available to test methods.
  • Provided via the Glusto import “from glusto.core import Glusto as g”

To use, 1) Subclass CarteTestClass, 2) Override __init__ to define variables, 3) Import your subclass and add a decorator of the same name to your tests.

Carteplex is “Cartesian Multiplexing”. And that’s simplified from the original Carteprodplexorator (Cartesian Product Multiplexing Decorator).

See docs for more information and use-case examples.

class glusto.carteplex.Carteplex

Bases: object

Main class for cartesian product classes

class CarteTestClass(value)

Bases: object

Decorator providing cartesian product parameter-like capability for unittest class

Override to provide data specific to your tests.

Parameters:value (object) – data automatically provided by the decorator.
__call__(obj)

The engine behind the cartesian product multiplexing (carteplex) goodness. Do not override.

Parameters:obj (object) – object automatically passed by the decorator.
Returns:An empty object. (removes original testclass from run)