def test_imported_service_factory(self):

        class IFoo(Interface):
            price = Int

        # Register a service factory.
        self.service_registry.register_service(
            HasTraits,
            PKG + '.service_registry_test_case.service_factory',
            {'price' : 100}
        )

        # Create a query that matches the registered object.
        service = self.service_registry.get_service(HasTraits, 'price <= 100')
        self.assertNotEqual(None, service)
        self.assertEqual(HasTraits, type(service))

        # This shows that the properties were passed in to the factory.
        self.assertEqual(100, service.price)

        # Make sure that the object created by the factory is cached (i.e. we
        # get the same object back from now on!).
        service2 = self.service_registry.get_service(HasTraits, 'price <= 100')
        self.assert_(service is service2)

        return
imported service factory
dataset/ETHPy150Open enthought/envisage/envisage/tests/service_registry_test_case.py/ServiceRegistryTestCase.test_imported_service_factory