[runner] Add support for "folding" block delimiter (#654)

This commit is contained in:
jugglinmike 2016-05-31 18:04:31 -04:00 committed by Leo Balter
parent 1e75730d5f
commit 330cea98f5
2 changed files with 6 additions and 1 deletions

View File

@ -43,7 +43,7 @@ def load(str):
return dict
def myReadValue(lines, value):
if value == ">":
if value == ">" or value == "|":
(lines, value) = myMultiline(lines, value)
value = value + "\n"
return (lines, value)

View File

@ -81,6 +81,11 @@ class TestMonkeyYAMLParsing(unittest.TestCase):
self.assertEqual(lines, [" other: 42"])
self.assertEqual(value, "foo bar")
def test_Multiline_5(self):
lines = ["info: |", " attr: this is a string (not nested yaml)", ""]
y = "\n".join(lines)
self.assertEqual(monkeyYaml.load(y), yaml.load(y))
def test_myLeading(self):
self.assertEqual(2, monkeyYaml.myLeadingSpaces(" foo"))
self.assertEqual(2, monkeyYaml.myLeadingSpaces(" "))