diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2016-12-13 17:10:49 +0100 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2016-12-13 17:10:49 +0100 |
commit | 5eb7b948f5428cda280c323383c7b604cef78fb7 (patch) | |
tree | 6aeeb82f5fa50bcc9279d63ff3458c35dc75f432 /tests | |
parent | c658e0898734b1d3c73853f393cc4d57c92276be (diff) |
Actually index stuff, except nothing is indexed
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_collection.py | 14 |
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() |