diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_collection.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py index 2b1864a..cc28a27 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -116,6 +116,23 @@ class testCollection(unittest.TestCase): ) self.assertEqual(entry.uid, '11189ee47ddf4796b718a483b379f976') + def test_entry_from_short_uid(self): + self.collection = lesana.Collection('tests/data/simple') + entries = self.collection.entries_from_short_uid( + '11189ee4' + ) + self.assertEqual(len(entries), 1) + self.assertEqual(entries[0].uid, '11189ee47ddf4796b718a483b379f976') + entries = self.collection.entries_from_short_uid( + '11189ee47ddf4796b718a483b379f976' + ) + self.assertEqual(len(entries), 1) + self.assertEqual(entries[0].uid, '11189ee47ddf4796b718a483b379f976') + entries = self.collection.entries_from_short_uid( + '12345678' + ) + self.assertEqual(len(entries), 0) + def test_index_missing_file(self): self.collection = lesana.Collection('tests/data/simple') with self.assertLogs(level=logging.WARNING) as cm: |