summaryrefslogtreecommitdiff
path: root/tests/plugins/yamlrdr.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/plugins/yamlrdr.py')
-rw-r--r--tests/plugins/yamlrdr.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/plugins/yamlrdr.py b/tests/plugins/yamlrdr.py
index b9a99a2..dbd9651 100644
--- a/tests/plugins/yamlrdr.py
+++ b/tests/plugins/yamlrdr.py
@@ -4,7 +4,6 @@
from chrysacase import ChrysalideTestCase
from pychrysalide.plugins.yaml import YamlReader
-import tempfile
class TestYamlReader(ChrysalideTestCase):
@@ -234,3 +233,29 @@ root:
sub = found[0].find_one_by_path('/aa')
self.assertIsNotNone(sub)
self.assertEqual(sub.key, 'aa')
+
+
+ def testItemsWithoutValue(self):
+ """Find items without values."""
+
+ from pychrysalide import core
+ core.set_verbosity(5)
+
+ data = '''
+vals:
+ - 1
+ - 2
+ - 3
+
+'''
+
+ reader = YamlReader(text=data)
+ self.assertIsNotNone(reader)
+
+ found = reader.tree.find_by_path('/vals/')
+
+ self.assertEqual(len(found), 3)
+
+ self.assertEqual(found[0].nodes[0].key, '1')
+ self.assertEqual(found[1].nodes[0].key, '2')
+ self.assertEqual(found[2].nodes[0].key, '3')