mirror of
https://github.com/microsoft/graphrag.git
synced 2026-02-02 17:21:32 +08:00
Some checks are pending
Python Build and Type Check / python-ci (ubuntu-latest, 3.11) (push) Waiting to run
Python Build and Type Check / python-ci (ubuntu-latest, 3.12) (push) Waiting to run
Python Build and Type Check / python-ci (windows-latest, 3.11) (push) Waiting to run
Python Build and Type Check / python-ci (windows-latest, 3.12) (push) Waiting to run
Python Integration Tests / python-ci (ubuntu-latest, 3.12) (push) Waiting to run
Python Integration Tests / python-ci (windows-latest, 3.12) (push) Waiting to run
Python Notebook Tests / python-ci (ubuntu-latest, 3.12) (push) Waiting to run
Python Notebook Tests / python-ci (windows-latest, 3.12) (push) Waiting to run
Python Smoke Tests / python-ci (ubuntu-latest, 3.12) (push) Waiting to run
Python Smoke Tests / python-ci (windows-latest, 3.12) (push) Waiting to run
Python Unit Tests / python-ci (ubuntu-latest, 3.12) (push) Waiting to run
Python Unit Tests / python-ci (windows-latest, 3.12) (push) Waiting to run
* remove optional embeddings * fix test * fix tests * fix pipeline * fix test * fix test * fix test * fix tests --------- Co-authored-by: Gaudy Blanco <gaudy-microsoft@MacBook-Pro-m4-Gaudy-For-Work.local>
21 lines
638 B
Python
21 lines
638 B
Python
# Copyright (c) 2024 Microsoft Corporation.
|
|
# Licensed under the MIT License
|
|
|
|
import pytest
|
|
from graphrag.config.embeddings import create_index_name
|
|
|
|
|
|
def test_create_index_name():
|
|
collection = create_index_name("default", "entity_description")
|
|
assert collection == "default-entity_description"
|
|
|
|
|
|
def test_create_index_name_invalid_embedding_throws():
|
|
with pytest.raises(KeyError):
|
|
create_index_name("default", "invalid.name")
|
|
|
|
|
|
def test_create_index_name_invalid_embedding_does_not_throw():
|
|
collection = create_index_name("default", "invalid_name", validate=False)
|
|
assert collection == "default-invalid_name"
|