mirror of https://github.com/arc53/DocsGPT
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
945 B
Python
33 lines
945 B
Python
from application.app import get_vectorstore, is_azure_configured
|
|
import os
|
|
|
|
|
|
# Test cases for get_vectorstore function
|
|
def test_no_active_docs():
|
|
data = {}
|
|
assert get_vectorstore(data) == os.path.join("application", "")
|
|
|
|
|
|
def test_local_default_active_docs():
|
|
data = {"active_docs": "local/default"}
|
|
assert get_vectorstore(data) == os.path.join("application", "")
|
|
|
|
|
|
def test_local_non_default_active_docs():
|
|
data = {"active_docs": "local/something"}
|
|
assert get_vectorstore(data) == os.path.join("application", "indexes/local/something")
|
|
|
|
|
|
def test_default_active_docs():
|
|
data = {"active_docs": "default"}
|
|
assert get_vectorstore(data) == os.path.join("application", "")
|
|
|
|
|
|
def test_complex_active_docs():
|
|
data = {"active_docs": "local/other/path"}
|
|
assert get_vectorstore(data) == os.path.join("application", "indexes/local/other/path")
|
|
|
|
|
|
def test_is_azure_configured():
|
|
assert not is_azure_configured()
|