'The C{connectionMade} and C{connectionLost} methods of
L{DNSServerFactory} cooperate to keep track of all L{DNSProtocol}
objects created by a factory which are connected.'

def test_connectionTracking(self):

    (protoA, protoB) = (object(), object())
    factory = server.DNSServerFactory()
    factory.connectionMade(protoA)
    self.assertEqual(factory.connections, [protoA])
    factory.connectionMade(protoB)
    self.assertEqual(factory.connections, [protoA, protoB])
    factory.connectionLost(protoA)
    self.assertEqual(factory.connections, [protoB])
    factory.connectionLost(protoB)
    self.assertEqual(factory.connections, [])
