Mox: a factory for creating mock objects.
Definition at line 150 of file bloaty/third_party/protobuf/python/mox.py.
◆ __init__() [1/2]
def mox.Mox.__init__ |
( |
|
self | ) |
|
◆ __init__() [2/2]
def mox.Mox.__init__ |
( |
|
self | ) |
|
◆ CreateMock() [1/2]
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.
Definition at line 164 of file bloaty/third_party/protobuf/python/mox.py.
◆ CreateMock() [2/2]
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.
Definition at line 164 of file protobuf/python/mox.py.
◆ CreateMockAnything() [1/2]
def mox.Mox.CreateMockAnything |
( |
|
self | ) |
|
◆ CreateMockAnything() [2/2]
def mox.Mox.CreateMockAnything |
( |
|
self | ) |
|
Create a mock that will accept any method calls.
This does not enforce an interface.
Definition at line 179 of file protobuf/python/mox.py.
◆ ReplayAll() [1/2]
def mox.Mox.ReplayAll |
( |
|
self | ) |
|
◆ ReplayAll() [2/2]
def mox.Mox.ReplayAll |
( |
|
self | ) |
|
◆ ResetAll() [1/2]
def mox.Mox.ResetAll |
( |
|
self | ) |
|
◆ ResetAll() [2/2]
def mox.Mox.ResetAll |
( |
|
self | ) |
|
◆ StubOutWithMock() [1/2]
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.
Definition at line 208 of file protobuf/python/mox.py.
◆ StubOutWithMock() [2/2]
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.
Definition at line 208 of file bloaty/third_party/protobuf/python/mox.py.
◆ UnsetStubs() [1/2]
def mox.Mox.UnsetStubs |
( |
|
self | ) |
|
◆ UnsetStubs() [2/2]
def mox.Mox.UnsetStubs |
( |
|
self | ) |
|
◆ VerifyAll() [1/2]
def mox.Mox.VerifyAll |
( |
|
self | ) |
|
◆ VerifyAll() [2/2]
def mox.Mox.VerifyAll |
( |
|
self | ) |
|
◆ _mock_objects
◆ _USE_MOCK_OBJECT
list mox.Mox._USE_MOCK_OBJECT |
|
staticprivate |
◆ stubs
The documentation for this class was generated from the following file: