userver: samples/static_service/testsuite/conftest.py
Loading...
Searching...
No Matches
samples/static_service/testsuite/conftest.py
1import pathlib
2
3import pytest
4
5pytest_plugins = ['pytest_userver.plugins.core']
6
7USERVER_CONFIG_HOOKS = ['static_config_hook']
8
9
10@pytest.fixture(scope='session')
11def static_config_hook(service_source_dir):
12 def _patch_config(config_yaml, config_vars):
13 components = config_yaml['components_manager']['components']
14 assert 'fs-cache-main' in components
15 components['fs-cache-main']['dir'] = str(
16 pathlib.Path(service_source_dir).joinpath('public'),
17 )
18
19 return _patch_config