def test_created(self, send_bus_command, CreateFuncKeyEvent): new_event = CreateFuncKeyEvent.return_value = Mock() func_key = FuncKey(id=1, type='speeddial', destination='user', destination_id=2) notifier.created(func_key) CreateFuncKeyEvent.assert_called_once_with(func_key.id, func_key.type, func_key.destination, func_key.destination_id) send_bus_command.assert_called_once_with(new_event)
def create(func_key): validator.validate_create(func_key) created_func_key = dao.create(func_key) notifier.created(created_func_key) return created_func_key