diff options
Diffstat (limited to 'tests/test_collection.py')
-rw-r--r-- | tests/test_collection.py | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py index 63820d5..64dd293 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -1,10 +1,22 @@ -from __future__ import division -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - +import os.path +import shutil import unittest -class testCollection(unittest.TestCase): - def test_noting(self): - pass +import lesana + + +class testCollectionLoading(unittest.TestCase): + def tearDown(self): + shutil.rmtree(os.path.join(self.collection.basedir, '.lesana')) + + def test_empty(self): + self.collection = lesana.Collection('tests/data/empty') + self.assertIsNone(self.collection.schema) + self.assertIsNotNone(self.collection.cache) + + 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) |