Ejemplo n.º 1
0
 def test_connect(self):
     service = FedoraMessagingService()
     service.factory = mock.Mock()
     service.connect()
     self.assertEqual(len(service.services), 1)
     serv = service.services[0]
     self.assertTrue(serv.factory is service.factory)
     self.assertTrue(serv.parent is service)
     self.assertIsInstance(serv, TCPClient)
Ejemplo n.º 2
0
 def test_connect_tls(self):
     """Assert connecting with amqps starts an SSLClient."""
     service = FedoraMessagingService("amqps://")
     service.factory = mock.Mock()
     service.connect()
     self.assertEqual(len(service.services), 1)
     serv = service.services[0]
     self.assertTrue(serv.factory is service.factory)
     self.assertTrue(serv.parent is service)
     self.assertIsInstance(serv, SSLClient)