@contextmanager<EOL><INDENT>def index(self):<DEDENT>
from docido_sdk.index.config import YamlPullCrawlersIndexingConfig<EOL>config_yaml = osp.splitext(__file__)[<NUM_LIT:0>] + '<STR_LIT>'<EOL>with docido_config:<EOL><INDENT>docido_config.clear()<EOL>docido_config.update(Configuration.from_file(config_yaml))<EOL>env = Environment()<EOL>env.temp_dir = tempfile.mkdtemp()<EOL>test_components = self._setup_test_components(env)<EOL>pipeline = env[IndexPipelineProvider]<EOL>env[Elasticsearch]<EOL>try:<EOL><INDENT>env[YamlPullCrawlersIndexingConfig]<EOL>yield pipeline.get_index_api(None, None, None, None)<EOL><DEDENT>finally:<EOL><INDENT>for test_component in test_components:<EOL><INDENT>test_component.unregister()<EOL>if osp.isdir(env.temp_dir):<EOL><INDENT>shutil.rmtree(env.temp_dir)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Create new environment, fill it, and create an IndexAPI