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

Method _CreateMockMethod

deps/protobuf/python/mox.py:295–307  ·  view source on GitHub ↗

Create a new mock method call and return it. Args: # method name: the name of the method being called. method_name: str Returns: A new MockMethod aware of MockAnything's state (record or replay).

(self, method_name)

Source from the content-addressed store, hash-verified

293 return self._CreateMockMethod(method_name)
294
295 def _CreateMockMethod(self, method_name):
296 """Create a new mock method call and return it.
297
298 Args:
299 # method name: the name of the method being called.
300 method_name: str
301
302 Returns:
303 A new MockMethod aware of MockAnything's state (record or replay).
304 """
305
306 return MockMethod(method_name, self._expected_calls_queue,
307 self._replay_mode)
308
309 def __nonzero__(self):
310 """Return 1 for nonzero so the mock can be used as a conditional."""

Callers 5

__getattr__Method · 0.95
__getattr__Method · 0.80
__setitem__Method · 0.80
__getitem__Method · 0.80
__call__Method · 0.80

Calls 1

MockMethodClass · 0.85

Tested by

no test coverage detected