From 9ee3f01e454d1d56b5f0a31b30bbc8a5a2f50469 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Sun, 10 Jan 2021 11:38:12 +0100 Subject: Test that all entries are indexed --- tests/test_collection.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_collection.py b/tests/test_collection.py index 4668096..f7ee31f 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -130,8 +130,9 @@ class testEmptyCollection(unittest.TestCase): def test_loaded(self): self.assertEqual(self.collection.settings, {}) - self.collection.update_cache() + indexed = self.collection.update_cache() self.assertIsNotNone(self.collection.stemmer) + self.assertEqual(indexed, 0) class testSimpleCollection(unittest.TestCase): @@ -151,8 +152,9 @@ class testSimpleCollection(unittest.TestCase): self.assertEqual(len(self.collection.settings['fields']), 7) self.assertEqual(len(self.collection.indexed_fields), 3) - self.collection.update_cache() + indexed = self.collection.update_cache() self.assertIsNotNone(self.collection.stemmer) + self.assertEqual(indexed, 3) def test_full_search(self): self.collection.start_search('Item') @@ -221,7 +223,8 @@ class testSimpleCollection(unittest.TestCase): self.assertIn("non_existing_file", cm.output[0]) def test_index_reset(self): - self.collection.update_cache(reset=True) + indexed = self.collection.update_cache(reset=True) + self.assertEqual(indexed, 3) def test_get_entry_missing_eid(self): entry = self.collection.entry_from_eid('this is not an eid') -- cgit v1.2.3