def METHOD_NAME(self):
    fp = tempfile.NamedTemporaryFile()
    ssh_args = self.docker_ssh_default_kwargs.get('ssh_args', [])
    try:
        context = self.docker_ssh(
            username='mitogen__has_sudo',
            password='has_sudo_password',
            ssh_args=ssh_args + ['-o', 'UserKnownHostsFile %s' % fp.name],
            check_host_keys='accept',
        )
        context.shutdown(wait=True)
        fp.seek(0)
        # Lame test, but we're about to use enforce mode anyway, which
        # verifies the file contents.
        self.assertGreater(len(fp.read()), 0)
        context = self.docker_ssh(
            username='mitogen__has_sudo',
            password='has_sudo_password',
            ssh_args=ssh_args + ['-o', 'UserKnownHostsFile %s' % fp.name],
            check_host_keys='enforce',
        )
        context.shutdown(wait=True)
    finally:
        fp.close()