diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-02-08 10:39:20 +0100 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-02-08 10:39:20 +0100 |
commit | 78b9390b2a91235c235eabd1e5dbc002fa28fb93 (patch) | |
tree | 71a4fe35b2949a991257666b9dc03881c5529aa1 | |
parent | 61d154920d158767dc2b29bf9239f74d0dcdc751 (diff) |
More tests for empty data
-rw-r--r-- | tests/data/complex/items/5084bc6e94f24dc6976629282ef30419.yaml | 2 | ||||
-rw-r--r-- | tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml | 2 | ||||
-rw-r--r-- | tests/data/complex/settings.yaml | 4 | ||||
-rw-r--r-- | tests/test_collection.py | 6 |
4 files changed, 13 insertions, 1 deletions
diff --git a/tests/data/complex/items/5084bc6e94f24dc6976629282ef30419.yaml b/tests/data/complex/items/5084bc6e94f24dc6976629282ef30419.yaml index 6abdd6d..d4cdaba 100644 --- a/tests/data/complex/items/5084bc6e94f24dc6976629282ef30419.yaml +++ b/tests/data/complex/items/5084bc6e94f24dc6976629282ef30419.yaml @@ -13,4 +13,6 @@ exists: true with_default: default value amount: 1 order: delta +created: +epoch: # and a comment at the end diff --git a/tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml b/tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml index da82d8d..ab9dc70 100644 --- a/tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml +++ b/tests/data/complex/items/8e9fa1ed3c1b4a30a6be7a98eda0cfa7.yaml @@ -11,3 +11,5 @@ exists: with_default: 'default value' amount: 0 order: +created: +epoch: diff --git a/tests/data/complex/settings.yaml b/tests/data/complex/settings.yaml index 1fd36b5..0bdcabb 100644 --- a/tests/data/complex/settings.yaml +++ b/tests/data/complex/settings.yaml @@ -39,3 +39,7 @@ fields: type: string index: field sortable: true + - name: created + type: datetime + - name: epoch + type: datetime diff --git a/tests/test_collection.py b/tests/test_collection.py index 1e37589..9f83655 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -289,7 +289,7 @@ class testComplexCollection(unittest.TestCase): self.collection.settings['name'], "Fully featured lesana collection", ) - self.assertEqual(len(self.collection.settings['fields']), 10) + self.assertEqual(len(self.collection.settings['fields']), 12) self.assertIsNotNone(self.collection.stemmer) self.assertEqual(len(self.collection.indexed_fields), 8) @@ -317,6 +317,10 @@ class testComplexCollection(unittest.TestCase): self.assertIn("name: ''", entry.yaml_data) self.assertIn('with_default', entry.yaml_data) self.assertIn('amount: 0', entry.yaml_data) + self.assertIn("tags: []", entry.yaml_data) + self.assertIn("exists:\n", entry.yaml_data) + self.assertIn("created:\n", entry.yaml_data) + self.assertIn("epoch:\n", entry.yaml_data) def test_load_field_loaders(self): # Check that all fields have been loaded, with the right types |