def test_service_protocol(self):

        class IFoo(Interface):
            pass

        class IBar(Interface):
            pass

        @provides(IFoo, IBar)
        class Foo(HasTraits):
            pass

        class PluginA(Plugin):
            id = 'A'
            foo = Instance(Foo, (), service=True, service_protocol=IBar)

        a = PluginA()

        application = TestApplication(plugins=[a])
        application.start()

        # Make sure the service was registered with the 'IBar' protocol.
        self.assertNotEqual(None, application.get_service(IBar))
        self.assertEqual(a.foo, application.get_service(IBar))

        application.stop()

        # Make sure the service was unregistered.
        self.assertEqual(None, application.get_service(IBar))

        return
service protocol
dataset/ETHPy150Open enthought/envisage/envisage/tests/plugin_test_case.py/PluginTestCase.test_service_protocol