Example #1
0
 def set_up(self):
     Session.remove()
     EntityTestCase.set_up(self)
     local_settings = self.config.get_settings()
     tractor_config_file = local_settings['tractor_config_file']
     tractor_api = make_api_from_config(tractor_config_file)
     self.config.registry.registerUtility(tractor_api, ITractor)  # pylint: disable=E1103
Example #2
0
 def set_up(self):
     Session.remove()
     EntityTestCase.set_up(self)
     local_settings = self.config.get_settings()
     tractor_config_file = local_settings['tractor_config_file']
     tractor_api = make_api_from_config(tractor_config_file)
     self.config.registry.registerUtility(tractor_api, ITractor) # pylint: disable=E1103
Example #3
0
File: run.py Project: papagr/TheLMA
def create_config(settings, package='thelma', registry=None):
    """
    Returns a configurator for TheLMA.
    """
    config = Configurator(package=package, registry=registry)
    if registry is None:
        config.setup_registry(settings=settings, root_factory=RootFactory())
        config.load_zcml('configure.zcml')
    # tractor registration
    tractor_config_file = settings['tractor_config_file']
    tractor_api = make_api_from_config(tractor_config_file)
    config.registry.registerUtility(tractor_api, ITractor)  # pylint: disable=E1103
    return config
Example #4
0
def create_config(settings, package='thelma', registry=None):
    """
    Returns a configurator for TheLMA.
    """
    config = Configurator(package=package,
                          registry=registry)
    if registry is None:
        config.setup_registry(settings=settings,
                              root_factory=RootFactory())
        config.load_zcml('configure.zcml')
    # tractor registration
    tractor_config_file = settings['tractor_config_file']
    tractor_api = make_api_from_config(tractor_config_file)
    config.registry.registerUtility(tractor_api, ITractor) # pylint: disable=E1103
    return config
Example #5
0
 def test_create_from_config(self):
     fn = resource_filename('tractor', 'tests/test_simple.ini')
     api = make_api_from_config(fn)
     self.assertTrue(isinstance(api, TractorApi))
Example #6
0
 def test_create_from_config(self):
     fn = resource_filename('tractor', 'tests/test_simple.ini')
     api = make_api_from_config(fn)
     self.assertTrue(isinstance(api, TractorApi))