diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2018-12-15 18:48:57 +0100 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2019-09-08 12:50:12 +0200 |
commit | f44e855f0462b105f54a0dea826e6fdcd60925db (patch) | |
tree | 4ca2a5217f1f23a7c4d9af8ae6b44e1acf31c029 | |
parent | 1d78b63ec6dcbb9a0fb4817e3cded58f08c53e92 (diff) |
Added new data type: boolean
-rw-r--r-- | docs/field_types.rst | 2 | ||||
-rw-r--r-- | tests/data/complex/items/73097121f1874a6ea2f927db7dc4f11e.yaml | 1 | ||||
-rw-r--r-- | tests/data/complex/settings.yaml | 3 | ||||
-rw-r--r-- | tests/test_collection.py | 10 |
4 files changed, 14 insertions, 2 deletions
diff --git a/docs/field_types.rst b/docs/field_types.rst index 9008348..89065aa 100644 --- a/docs/field_types.rst +++ b/docs/field_types.rst @@ -12,6 +12,8 @@ float: . timestamp: . +boolean: + . file: . url: diff --git a/tests/data/complex/items/73097121f1874a6ea2f927db7dc4f11e.yaml b/tests/data/complex/items/73097121f1874a6ea2f927db7dc4f11e.yaml index 1c7070c..b6787b0 100644 --- a/tests/data/complex/items/73097121f1874a6ea2f927db7dc4f11e.yaml +++ b/tests/data/complex/items/73097121f1874a6ea2f927db7dc4f11e.yaml @@ -8,3 +8,4 @@ something: '' tags: - this - that +exists: true diff --git a/tests/data/complex/settings.yaml b/tests/data/complex/settings.yaml index 612591f..440f4e9 100644 --- a/tests/data/complex/settings.yaml +++ b/tests/data/complex/settings.yaml @@ -23,3 +23,6 @@ fields: type: list list: string index: free + - name: exists + type: boolean + index: field diff --git a/tests/test_collection.py b/tests/test_collection.py index 66f034a..d1d6455 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -259,9 +259,9 @@ class testComplexCollection(unittest.TestCase): self.collection.settings['name'], "Fully featured lesana collection" ) - self.assertEqual(len(self.collection.settings['fields']), 6) + self.assertEqual(len(self.collection.settings['fields']), 7) self.assertIsNotNone(self.collection.stemmer) - self.assertEqual(len(self.collection.indexed_fields), 5) + self.assertEqual(len(self.collection.indexed_fields), 6) def test_index(self): self.collection.update_cache() @@ -275,6 +275,12 @@ class testComplexCollection(unittest.TestCase): for m in matches: self.assertIsInstance(m, lesana.Entry) + def test_boolean_field(self): + entry = self.collection.entry_from_uid( + '73097121f1874a6ea2f927db7dc4f11e' + ) + self.assertIsInstance(entry.data['exists'], bool) + class testCollectionWithErrors(unittest.TestCase): @classmethod |