def directory_file_store_service(tmp_path): config = build_config('DEV')['data'] config['dir_path'] = tmp_path / 'data' standard_tenant_provider = StandardTenantProvider() standard_tenant_provider.setup(Tenant(id='2', name="custom-tenant")) return DirectoryFileStoreService( standard_tenant_provider, config)
def swift_file_store_service(swift_auth_supplier, mock_http_client): data_config = build_config('DEV')['data'] standard_tenant_provider = StandardTenantProvider() standard_tenant_provider.setup(Tenant(id='2', name="custom-tenant")) return SwiftFileStoreService(standard_tenant_provider, swift_auth_supplier, mock_http_client, data_config)
def test_build_config_production(config_file): result = build_config(config_file, 'PROD') assert isinstance(result, ProductionConfig) assert result['domain'] == 'mediark.knowark.com' assert result['media'] == '/var/opt/mediark/media' assert result['shelve'] == '/var/opt/mediark/shelve'
def app(tmp_path, loop, aiohttp_client) -> web.Application: config = build_config('DEV') strategy = build_strategy(config['strategies'], config['strategy']) factory = build_factory(config) resolver = Injectark(strategy, factory) app = create_app(config, resolver) return loop.run_until_complete(aiohttp_client(app))
def test_create_app(): config = build_config('DEV') strategy = build_strategy(config['strategies'], config['strategy']) factory = build_factory(config) injector = Injectark(strategy, factory) app = create_app(config, injector) assert app is not None assert isinstance(app, web.Application)
def test_build_configurations() -> None: config_path = ".config.json" config = build_config("DEV", config_path) assert isinstance(config, DevelopmentConfig) config = build_config("PROD", config_path) assert isinstance(config, ProductionConfig)
def test_build_config_production_no_file(): path = 'missing_config.json' result = build_config(path, 'PROD') assert isinstance(result, ProductionConfig) assert result['domain'] == 'http://0.0.0.0:8080'
def test_build_config_production_no_file(): path = 'missing_config.json' result = build_config('PROD', path) assert isinstance(result, ProductionConfig)
def test_build_config_production(config_file): result = build_config('PROD', config_file) assert isinstance(result, ProductionConfig)
def test_build_config_development(config_file): result = build_config('DEV', config_file) assert isinstance(result, DevelopmentConfig)