def METHOD_NAME(returncodes={}):
    """Create a mock for sarge.Command
    returncodes is a dictionary of commands as keys
    and returncodes as values, so we can control which
    command line tools act like they pass or fail.
    By default, every command will return zero unless
    explicitly told to exit with something else.
    """
    def the_real_mock(cmd, **kwargs):
        the_mock = mock.Mock()
        the_mock.args = cmd
        def run():
            returncode = returncodes.get(str(cmd), 0)
            the_mock.returncode = returncode
        the_mock.run.side_effect = run
        return the_mock
    return the_real_mock