'Simple mock for QHostInfo::fromName returning a FakeDNSAnswer.'

def fromname_mock(self, _host):

    if (self.answer is None):
        raise ValueError('Got    called    without    answer    being    set.    This    means    something    tried    to    make    an    unexpected    DNS    request    (QHostInfo::fromName).')
    if self.used:
        raise ValueError('Got    used    twice!.')
    self.used = True
    return self.FakeDNSAnswer(error=self._get_error)
