webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Static Public Member Functions | List of all members
mox.MoxMetaTestBase Class Reference
Inheritance diagram for mox.MoxMetaTestBase:

Public Member Functions

def __init__ (cls, name, bases, d)
 

Static Public Member Functions

def CleanUpTest (cls, func)
 

Detailed Description

Metaclass to add mox cleanup and verification to every test.

As the mox unit testing class is being constructed (MoxTestBase or a
subclass), this metaclass will modify all test functions to call the
CleanUpMox method of the test class after they finish. This means that
unstubbing and verifying will happen for every test with no additional code,
and any failures will result in test failures as opposed to errors.

Constructor & Destructor Documentation

◆ __init__()

def mox.MoxMetaTestBase.__init__ (   cls,
  name,
  bases,
  d 
)

Member Function Documentation

◆ CleanUpTest()

def mox.MoxMetaTestBase.CleanUpTest (   cls,
  func 
)
static
Adds Mox cleanup code to any MoxTestBase method.

Always unsets stubs after a test. Will verify all mocks for tests that
otherwise pass.

Args:
  cls: MoxTestBase or subclass; the class whose test method we are altering.
  func: method; the method of the MoxTestBase test class we wish to alter.

Returns:
  The modified method.

The documentation for this class was generated from the following file: