Here are the examples of the python api fedora_messaging.twisted.service.FedoraMessagingServiceV2 taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
4 Examples
3
Source : test_service.py
with GNU General Public License v2.0
from fedora-infra
with GNU General Public License v2.0
from fedora-infra
def test_init(self):
service = FedoraMessagingServiceV2("amqp://example.com:4242")
self.assertTrue(isinstance(service._parameters, pika.URLParameters))
self.assertEqual(service._parameters.host, "example.com")
self.assertEqual(service._parameters.port, 4242)
self.assertEqual(getattr(service._parameters, "ssl", False), False)
self.assertEqual(
service._parameters.client_properties, config.conf["client_properties"]
)
self.assertIsInstance(service._service.factory, FedoraMessagingFactoryV2)
self.assertEqual(len(service.services), 1)
self.assertTrue(service.services[0] is service._service)
self.assertTrue(service._service.parent is service)
self.assertIsInstance(service._service, TCPClient)
def test_init_tls(self):
3
Source : test_service.py
with GNU General Public License v2.0
from fedora-infra
with GNU General Public License v2.0
from fedora-infra
def test_init_tls(self):
"""Assert creating the service with an amqps URL configures TLS."""
service = FedoraMessagingServiceV2("amqps://")
self.assertTrue(isinstance(service._parameters, pika.URLParameters))
self.assertIsNotNone(service._parameters.ssl_options)
self.assertEqual(len(service.services), 1)
self.assertIsInstance(service.services[0], SSLClient)
def test_init_client_props_override(self):
3
Source : test_service.py
with GNU General Public License v2.0
from fedora-infra
with GNU General Public License v2.0
from fedora-infra
def test_stopService(self):
service = FedoraMessagingServiceV2("amqps://")
service._service = mock.Mock()
service.stopService()
service._service.factory.stopTrying.assert_called_once()
service._service.factory.stopFactory.assert_called_once()
class ConfigureTlsParameters(TestCase):
0
Source : test_service.py
with GNU General Public License v2.0
from fedora-infra
with GNU General Public License v2.0
from fedora-infra
def test_init_client_props_override(self):
service = FedoraMessagingServiceV2("amqp://?client_properties={'foo':'bar'}")
self.assertEqual(service._parameters.client_properties, {"foo": "bar"})
def test_stopService(self):