'L{SecondaryAuthorityService.fromServerAddressAndDomains} constructs a
new L{SecondaryAuthorityService} from a C{str} giving a master server
address and DNS port and several domains, causing the creation of a secondary
authority for each domain and that master server address and the given
DNS port.'

def test_constructAuthorityFromHostAndPort(self):

    primary = '192.168.1.3'
    port = 5335
    service = SecondaryAuthorityService.fromServerAddressAndDomains((primary, port), ['example.net', 'example.edu'])
    self.assertEqual(service.primary, primary)
    self.assertEqual(service._port, 5335)
    self.assertEqual(service.domains[0].primary, primary)
    self.assertEqual(service.domains[0]._port, port)
    self.assertEqual(service.domains[0].domain, 'example.net')
    self.assertEqual(service.domains[1].primary, primary)
    self.assertEqual(service.domains[1]._port, port)
    self.assertEqual(service.domains[1].domain, 'example.edu')
