webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Public Member Functions | |
def | __init__ (self) |
def | CreateMock (self, class_to_mock) |
def | CreateMockAnything (self) |
def | ReplayAll (self) |
def | VerifyAll (self) |
def | ResetAll (self) |
def | StubOutWithMock (self, obj, attr_name, use_mock_anything=False) |
def | UnsetStubs (self) |
Public Attributes | |
stubs | |
Mox: a factory for creating mock objects.
def mox.Mox.__init__ | ( | self | ) |
Initialize a new Mox.
def mox.Mox.CreateMock | ( | self, | |
class_to_mock | |||
) |
Create a new mock object. Args: # class_to_mock: the class to be mocked class_to_mock: class Returns: MockObject that can be used as the class_to_mock would be.
def mox.Mox.CreateMockAnything | ( | self | ) |
Create a mock that will accept any method calls. This does not enforce an interface.
def mox.Mox.ReplayAll | ( | self | ) |
Set all mock objects to replay mode.
def mox.Mox.ResetAll | ( | self | ) |
Call reset on all mock objects. This does not unset stubs.
def mox.Mox.StubOutWithMock | ( | self, | |
obj, | |||
attr_name, | |||
use_mock_anything = False |
|||
) |
Replace a method, attribute, etc. with a Mock. This will replace a class or module with a MockObject, and everything else (method, function, etc) with a MockAnything. This can be overridden to always use a MockAnything by setting use_mock_anything to True. Args: obj: A Python object (class, module, instance, callable). attr_name: str. The name of the attribute to replace with a mock. use_mock_anything: bool. True if a MockAnything should be used regardless of the type of attribute.
def mox.Mox.UnsetStubs | ( | self | ) |
Restore stubs to their original state.
def mox.Mox.VerifyAll | ( | self | ) |
Call verify on all mock objects created.
mox.Mox.stubs |