def test_remove_extension_point_listener(self):

        a = PluginA()
        b = PluginB()
        c = PluginC()

        # Start off with just one of the plugins.
        application = TestApplication(plugins=[a])
        application.start()

        def listener(extension_registry, event):
            """ An extension point listener. """

            listener.extension_point_id = event.extension_point_id
            listener.added   = event.added
            listener.removed = event.removed

            return

        # Make sure we can get the contributions via the application.
        extensions = application.get_extensions('a.x')
        self.assertEqual(0, len(extensions))

        # Add the listener.
        application.add_extension_point_listener(listener, 'a.x')

        # Now add one of the other plugins.
        application.add_plugin(b)

        # Make sure the listener was called.
        self.assertEqual('a.x', listener.extension_point_id)
        self.assertEqual([], listener.removed)
        self.assertEqual([1, 2, 3], listener.added)

        # Now remove the listener.
        listener.extension_point_id = None
        application.remove_extension_point_listener(listener, 'a.x')

        # Now add the final plugin.
        application.add_plugin(c)

        # Make sure the listener was *not* called.
        self.assertEqual(None, listener.extension_point_id)

        return
remove extension point listener
dataset/ETHPy150Open enthought/envisage/envisage/tests/application_test_case.py/ApplicationTestCase.test_remove_extension_point_listener