mocksafe.when
- mocksafe.when(mock_callable: Callable[[...], T]) WhenStubber[T]
Stub a mocked method / Callable.
- Parameters:
mock_callable – a mocked method / Callable that returns generic type T
- Return type:
WhenStubber[T]
- Example:
>>> when(mock_random.random) <mocksafe.apis.bdd.when_then.WhenStubber object at 0x...>
- Example:
>>> when(mock_random.random).any_call().then_return(0.31)