aboutsummaryrefslogtreecommitdiff
path: root/tests/test_collection.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_collection.py')
-rw-r--r--tests/test_collection.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py
index d0a9864..b70c85f 100644
--- a/tests/test_collection.py
+++ b/tests/test_collection.py
@@ -13,20 +13,20 @@ class testCollectionLoading(unittest.TestCase):
def test_empty(self):
self.collection = lesana.Collection('tests/data/empty')
self.assertEqual(self.collection.schema, {})
- self.assertIsNotNone(self.collection.cache)
- self.assertIsNotNone(self.collection.stemmer)
self.collection.update_cache()
+ self.assertIsNotNone(self.collection.cache)
+ self.assertIsNotNone(self.collection.stemmer)
def test_simple(self):
self.collection = lesana.Collection('tests/data/simple')
self.assertIsNotNone(self.collection.schema)
self.assertEqual(self.collection.schema['name'], "Simple lesana collection")
self.assertEqual(len(self.collection.schema['fields']), 3)
- self.assertIsNotNone(self.collection.cache)
- self.assertIsNotNone(self.collection.stemmer)
self.collection.update_cache()
+ self.assertIsNotNone(self.collection.cache)
+ self.assertIsNotNone(self.collection.stemmer)
def test_wrong_language(self):
# This loads a collection with an invalid value in lang
@@ -35,6 +35,12 @@ class testCollectionLoading(unittest.TestCase):
self.assertEqual(len(cm.output), 1)
self.assertIn("Invalid language", cm.output[0])
# The collection will default to english, but should still work.
+ self.collection.update_cache()
self.assertIsNotNone(self.collection.schema)
self.assertIsNotNone(self.collection.cache)
self.assertIsNotNone(self.collection.stemmer)
+
+ def test_unsafe(self):
+ self.collection = lesana.Collection('tests/data/simple')
+ self.collection.safe = False
+ self.collection.update_cache()