def METHOD_NAME(
    self, side_effect_exception, expected_exception_message, invoke_context_mock
):
    invoke_context_mock.side_effect = side_effect_exception
    with self.assertRaises(UserException) as context:
        self.call_cli()
    msg = str(context.exception)
    self.assertEqual(msg, expected_exception_message)