Exemplo n.º 1
0
"""Init package."""
import os

from orm.common.orm_common.injector import injector
import orm.services.image_manager.ims.di_providers as di_providers
from orm.services.image_manager.ims.logger import get_logger

logger = get_logger(__name__)

_current_dirname = os.path.dirname(os.path.realpath(di_providers.__file__))
injector.register_providers('IMS_ENV', _current_dirname, logger)
Exemplo n.º 2
0
 def test_register_providers_with_existing_provider(self, mock_import_file_by_name):
     mock_import_file_by_name.return_value = type('module', (object,), {'providers': ['a1', 'b2']})()
     os.environ['c3'] = 'test'
     injector.register_providers('c3', 'a/b/c', logger)
Exemplo n.º 3
0
 def test_register_providers_env_not_exist(self, mock_import_file_by_name):
     injector.register_providers('CMS_ENV1', 'a/b/c', logger)
Exemplo n.º 4
0
 def test_register_providers_env_test(self, mock_import_file_by_name):
     os.environ['CMS_ENV2'] = '__TEST__'
     injector.register_providers('CMS_ENV2', 'a/b/c', logger)
Exemplo n.º 5
0
 def test_register_providers(self, mock_import_file_by_name):
     os.environ['CMS_ENV'] = 'test'
     injector.register_providers('CMS_ENV', 'a/b/c', logger)