MCPcopy Create free account
hub / github.com/apple/coremltools / CreateMock

Method CreateMock

deps/protobuf/python/mox.py:164–177  ·  view source on GitHub ↗

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.

(self, class_to_mock)

Source from the content-addressed store, hash-verified

162 self.stubs = stubout.StubOutForTesting()
163
164 def CreateMock(self, class_to_mock):
165 """Create a new mock object.
166
167 Args:
168 # class_to_mock: the class to be mocked
169 class_to_mock: class
170
171 Returns:
172 MockObject that can be used as the class_to_mock would be.
173 """
174
175 new_mock = MockObject(class_to_mock)
176 self._mock_objects.append(new_mock)
177 return new_mock
178
179 def CreateMockAnything(self):
180 """Create a mock that will accept any method calls.

Callers 1

StubOutWithMockMethod · 0.95

Calls 2

MockObjectClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected