diff tests/test_indent.py @ 31:23616399f36c

make indent a @lines function and test
author Jeff Hammel <k0scist@gmail.com>
date Sun, 23 Feb 2014 14:48:40 -0800
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_indent.py	Sun Feb 23 14:48:40 2014 -0800
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+import os
+import unittest
+from textshaper.indent import indent
+
+class TestIndentation(unittest.TestCase):
+    """test textshaper indentation functionality"""
+
+    def test_indent(self):
+        text = """The quick brown fox
+  jumped over
+    the lazy dog."""
+
+        self.assertEqual(indent(text, indentation=4), """    The quick brown fox
+      jumped over
+        the lazy dog.""")
+
+if __name__ == '__main__':
+    unittest.main()