@contextmanager<EOL><INDENT>def index(self):<DEDENT>
from docido_sdk.index.config import YamlPullCrawlersIndexingConfig<EOL>with unregister_component(YamlPullCrawlersIndexingConfig):<EOL><INDENT>env = Environment()<EOL>env.temp_dir = tempfile.mkdtemp()<EOL>test_components = self._setup_test_components(env)<EOL>pipeline = env[IndexPipelineProvider]<EOL>try:<EOL><INDENT>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