Files
neuml--txtai/test/python/testdatabase/testcustom.py
T
wehub-resource-sync 3a7c47b2a6
build / build (macos-latest) (push) Waiting to run
build / build (ubuntu-latest) (push) Waiting to run
build / build (windows-latest) (push) Waiting to run
minimal / deploy (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:38:00 +08:00

30 lines
627 B
Python

"""
Custom database tests
"""
import unittest
from txtai.database import DatabaseFactory
class TestCustom(unittest.TestCase):
"""
Custom database backend tests.
"""
def testCustomBackend(self):
"""
Test resolving a custom backend
"""
database = DatabaseFactory.create({"content": "txtai.database.SQLite"})
self.assertIsNotNone(database)
def testCustomBackendNotFound(self):
"""
Test resolving an unresolvable backend
"""
with self.assertRaises(ImportError):
DatabaseFactory.create({"content": "notfound.database"})