Mercurial > hg > TextShaper
annotate tests/test_indent.py @ 34:88a69d587326
round1 of commands
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 02 Mar 2014 15:33:07 -0800 |
parents | 23616399f36c |
children |
rev | line source |
---|---|
31
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
2 |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
3 import os |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
4 import unittest |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
5 from textshaper.indent import indent |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
6 |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
7 class TestIndentation(unittest.TestCase): |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
8 """test textshaper indentation functionality""" |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
9 |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
10 def test_indent(self): |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
11 text = """The quick brown fox |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
12 jumped over |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
13 the lazy dog.""" |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
14 |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
15 self.assertEqual(indent(text, indentation=4), """ The quick brown fox |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
16 jumped over |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
17 the lazy dog.""") |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
18 |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
19 if __name__ == '__main__': |
23616399f36c
make indent a @lines function and test
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
20 unittest.main() |