diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-12-23 15:40:24 +0100 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-12-23 15:40:24 +0100 |
commit | b1eb8b81f875f2b9f7b38239f91bd0c716f86eb3 (patch) | |
tree | 0ebd689308a3938b9148b8fd0e420cc3de532086 /tests | |
parent | a7102f127d64a13d555d2085db84ae349532b499 (diff) |
Add a field with values to some test collections
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/complex/items/5084bc6e94f24dc6976629282ef30419.yaml | 1 | ||||
-rw-r--r-- | tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml | 1 | ||||
-rw-r--r-- | tests/data/complex/settings.yaml | 7 | ||||
-rw-r--r-- | tests/data/wrong/items/b9a832309c984ada9f267471660c1313.yaml | 1 | ||||
-rw-r--r-- | tests/data/wrong/settings.yaml | 6 | ||||
-rw-r--r-- | tests/test_collection.py | 8 |
6 files changed, 20 insertions, 4 deletions
diff --git a/tests/data/complex/items/5084bc6e94f24dc6976629282ef30419.yaml b/tests/data/complex/items/5084bc6e94f24dc6976629282ef30419.yaml index 3132884..c0d6e90 100644 --- a/tests/data/complex/items/5084bc6e94f24dc6976629282ef30419.yaml +++ b/tests/data/complex/items/5084bc6e94f24dc6976629282ef30419.yaml @@ -17,4 +17,5 @@ created: updated: epoch: version: 0 +category: first # and a comment at the end diff --git a/tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml b/tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml index 690b680..0580675 100644 --- a/tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml +++ b/tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml @@ -15,3 +15,4 @@ created: updated: epoch: version: 2 +category: first diff --git a/tests/data/complex/settings.yaml b/tests/data/complex/settings.yaml index 671a9b0..b85e2a2 100644 --- a/tests/data/complex/settings.yaml +++ b/tests/data/complex/settings.yaml @@ -53,3 +53,10 @@ fields: type: integer auto: increment increment: 2 + - name: category + type: string + values: + - first + - second + - third + index: field diff --git a/tests/data/wrong/items/b9a832309c984ada9f267471660c1313.yaml b/tests/data/wrong/items/b9a832309c984ada9f267471660c1313.yaml index 1fa0c74..371b9a0 100644 --- a/tests/data/wrong/items/b9a832309c984ada9f267471660c1313.yaml +++ b/tests/data/wrong/items/b9a832309c984ada9f267471660c1313.yaml @@ -6,3 +6,4 @@ number: 'four' float: 'half and a bit' price: 'cheap' things: +category: 'fourth' diff --git a/tests/data/wrong/settings.yaml b/tests/data/wrong/settings.yaml index bf79572..6b3a3bb 100644 --- a/tests/data/wrong/settings.yaml +++ b/tests/data/wrong/settings.yaml @@ -26,3 +26,9 @@ fields: - name: cloud type: cloud help: 'There is no cloud type' + - name: category + type: string + values: + - first + - second + - third diff --git a/tests/test_collection.py b/tests/test_collection.py index 2308633..00389cd 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -381,9 +381,9 @@ class testComplexCollection(unittest.TestCase): self.collection.settings['name'], "Fully featured lesana collection", ) - self.assertEqual(len(self.collection.settings['fields']), 14) + self.assertEqual(len(self.collection.settings['fields']), 15) self.assertIsNotNone(self.collection.stemmer) - self.assertEqual(len(self.collection.indexed_fields), 8) + self.assertEqual(len(self.collection.indexed_fields), 9) def test_index(self): indexed = self.collection.update_cache() @@ -574,7 +574,7 @@ class testCollectionWithErrors(unittest.TestCase): self.assertIsNotNone(self.collection.settings) self.assertIsNotNone(self.collection.stemmer) # Fields with no "index" entry are not indexed - self.assertEqual(len(self.collection.settings['fields']), 8) + self.assertEqual(len(self.collection.settings['fields']), 9) self.assertEqual(len(self.collection.indexed_fields), 3) def test_init(self): @@ -583,7 +583,7 @@ class testCollectionWithErrors(unittest.TestCase): self.collection.settings['name'], "Lesana collection with certain errors", ) - self.assertEqual(len(self.collection.settings['fields']), 8) + self.assertEqual(len(self.collection.settings['fields']), 9) self.assertIsNotNone(self.collection.stemmer) self.assertEqual(len(self.collection.indexed_fields), 3) |