-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Not sure if it is right place for this issue. Example from our tests:
identity_endpoint = mock.Mock()
identity_endpoint.post.return_value = request_factory.ApiResponse(201, {"data": identity})
def mock_endpoint(name):
mapping = [
(re.compile('^identities$'), identity_endpoint),
]
for regexp, endpoint in mapping:
if regexp.match(name):
return endpoint
else:
return mock.Mock()
api = mock.MagicMock()
api.endpoint.side_effect = mock_endpoint
Metadata
Metadata
Assignees
Labels
No labels