GenericWidgetTestCase

Inheritance diagram of GenericWidgetTestCase

class GenericWidgetTestCase[source]

Bases: taurus.qt.qtgui.test.base.BaseWidgetTestCase

a base class for testing common cases of arbitrary Taurus widget classes

To use it, simply inherit from GenericWidgetTestCase and unittest.TestCase and provide the following class members:

  • _klass (typeobject) the widget class to test (mandatory)

  • initargs (list) a list of arguments for the klass init method

    (default=[])

  • initkwargs (dict) a dict of keyword arguments for the klass init method

    (default={})

  • modelnames (list) a list of model names which the widget should be able

    to handle (default=[])

modelnames = []
setUp()[source]

Preconditions:

  • Those from BaseWidgetTestCase
  • A list of models corresponding to the modelnames list should be created without using the widget being tested (e.g. by using taurusManager.findObject()). None should be used as a placeholder when a model cannot be created for a given modelname.
test00_Instantiation()[source]

Check that the widget instantiates correctly

test10_SetModelsSequentially()[source]

Check that we can set several models sequentially