Skip to content

armgit / txtai

Public Imported from GitHub
0

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

Update tests

davidmezzetti442e370c5458
diff --git a/test/python/testscoring.py b/test/python/testscoring.py
index 4added04..72307623 100644
--- a/test/python/testscoring.py
+++ b/test/python/testscoring.py
@@ -109,7 +109,7 @@ class TestScoring(unittest.TestCase):
self.assertEqual(keys[0], "wins")
# Test save/load
- self.assertIsNotNone(self.save(scoring, config))
+ self.assertIsNotNone(self.save(scoring, config, f"scoring.{config['method']}.index"))
# Test search returns none when terms disabled (default)
self.assertIsNone(scoring.search("query"))
@@ -130,7 +130,7 @@ class TestScoring(unittest.TestCase):
# Test stop word is removed
self.assertFalse("and" in scoring.idf)
- def save(self, scoring, config, name="scoring"):
+ def save(self, scoring, config, name):
"""
Test scoring index save/load.
@@ -188,7 +188,7 @@ class TestScoring(unittest.TestCase):
Test scoring search.
Args:
- method: scoring method
+ config: scoring config
"""
# Create combined config
@@ -207,7 +207,7 @@ class TestScoring(unittest.TestCase):
self.assertEqual(index, 3)
# Test save/reload
- self.save(scoring, config)
+ self.save(scoring, config, f"scoring.{config['method']}.search")
# Re-run search and validate correct result returned
index, _ = scoring.search("bear", 1)[0]
@@ -233,7 +233,7 @@ class TestScoring(unittest.TestCase):
self.assertFalse(scoring.search("bear", 1))
# Save and validate count
- self.save(scoring, config)
+ self.save(scoring, config, f"scoring.{config['method']}.delete")
self.assertEqual(scoring.count(), len(self.data) - 1)
def normalize(self, config):
@@ -311,13 +311,13 @@ class TestScoring(unittest.TestCase):
scoring.index(self.data)
# Save/load index
- self.save(scoring, config)
+ self.save(scoring, config, f"scoring.{config['method']}.settings")
index, _ = scoring.search("bear bear bear wins", 1)[0]
self.assertEqual(index, 3)
# Save to same path
- self.save(scoring, config)
+ self.save(scoring, config, f"scoring.{config['method']}.settings")
# Save to different path
self.save(scoring, config, "scoring.move")
diff --git a/test/python/testworkflow.py b/test/python/testworkflow.py
index 3caafc6d..0d290556 100644
--- a/test/python/testworkflow.py
+++ b/test/python/testworkflow.py
@@ -73,6 +73,7 @@ class TestWorkflow(unittest.TestCase):
- transform
"""
+ @unittest.skipIf(os.name == "nt", "testBaseWorkflow skipped on Windows")
def testBaseWorkflow(self):
"""
Test a basic workflow
@@ -140,7 +141,7 @@ class TestWorkflow(unittest.TestCase):
self.assertEqual(index, 0)
self.assertEqual(data[0][1], "txtai builds an AI-powered index over sections")
- @unittest.skipIf(os.name == "nt", "testComplexWorkflow skipped on Windows")
+ @unittest.skipIf(os.name == "nt", "testConcurrentWorkflow skipped on Windows")
def testConcurrentWorkflow(self):
"""
Test running concurrent task actions