'Test content received after a query.'

def test_simpleQuery(self):

    d = self.proto.query([dns.Query('foo')])
    self.assertEqual(len(self.proto.liveMessages.keys()), 1)
    m = dns.Message()
    m.id = next(iter(self.proto.liveMessages.keys()))
    m.answers = [dns.RRHeader(payload=dns.Record_A(address='1.2.3.4'))]
    def cb(result):
        self.assertEqual(result.answers[0].payload.dottedQuad(), '1.2.3.4')
    d.addCallback(cb)
    s = m.toStr()
    s = (struct.pack('!H', len(s)) + s)
    self.proto.dataReceived(s)
    return d
