def _lookup(self, name, cls, qtype, timeout):
        """
        Return the result or failure on lookup.
        """
        self.lookups.append((name, cls, qtype, timeout))
        if self.results is not None:
            return defer.succeed((self.results, [], []))
        else:
            return defer.fail(self.failure)

        Return the result or failure on lookup.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/test/test_srvconnect.py