Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Build script update. Make test paths cross platform.

davidmezzettie25de8539684
diff --git a/test/python/testapi.py b/test/python/testapi.py
index d90a536e..31073f0f 100644
--- a/test/python/testapi.py
+++ b/test/python/testapi.py
@@ -6,7 +6,7 @@ import os
import tempfile
import unittest
-from unittest import mock
+from unittest.mock import patch
import numpy as np
@@ -50,7 +50,7 @@ class TestAPI(unittest.TestCase):
"""
@staticmethod
- @mock.patch.dict(os.environ, {"CONFIG": "/tmp/testapi.yml", "API_CLASS": "txtai.api.API"})
+ @patch.dict(os.environ, {"CONFIG": os.path.join(tempfile.gettempdir(), "testapi.yml"), "API_CLASS": "txtai.api.API"})
def start(full):
"""
Starts a mock FastAPI client.
diff --git a/test/python/testvectors.py b/test/python/testvectors.py
index 36280279..997fe024 100644
--- a/test/python/testvectors.py
+++ b/test/python/testvectors.py
@@ -39,7 +39,7 @@ class TestVectors(unittest.TestCase):
# Test non-existent path raises an exception
with self.assertRaises(IOError):
- Vectors.create("words", "/tmp/noexist", True, None)
+ Vectors.create("words", os.path.join(tempfile.gettempdir(), "noexist", True, None)
def testLookup(self):
"""