summaryrefslogtreecommitdiff
path: root/tests/test_templating.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_templating.py')
-rw-r--r--tests/test_templating.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/test_templating.py b/tests/test_templating.py
index 33889ae..aadcf66 100644
--- a/tests/test_templating.py
+++ b/tests/test_templating.py
@@ -28,7 +28,16 @@ class testFilters(unittest.TestCase):
"""
res = templating.to_yaml(s)
self.assertIsInstance(res, str)
- self.assertIn('"', res)
+ self.assertTrue(res.startswith('|'))
+ self.assertIn('\n', res)
+
+ s = """
+ short
+ multiline
+ """
+ res = templating.to_yaml(s)
+ self.assertIsInstance(res, str)
+ self.assertTrue(res.startswith('|'))
self.assertIn('\n', res)
res = templating.to_yaml(10)
@@ -37,6 +46,13 @@ class testFilters(unittest.TestCase):
res = templating.to_yaml(decimal.Decimal('10.1'))
self.assertEqual(res, "'10.1'")
+ s = "A very long line, but one that has no new lines " \
+ + "even if it is definitely longer than a standard " \
+ + "80 columns line"
+ res = templating.to_yaml(s)
+ self.assertTrue(res.startswith("|\n"))
+ self.assertNotIn('\n', res.lstrip("|\n"))
+
if __name__ == '__main__':
unittest.main()