# HG changeset patch # User Jeff Hammel # Date 1393194584 28800 # Node ID ead4d5877b8f011f6cbb2a008ead119a1bc38792 # Parent 2794327d8c67350021a89cbc7047e6ed35ccb86a STUB: tests/test_decorators.py diff -r 2794327d8c67 -r ead4d5877b8f tests/test_decorators.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test_decorators.py Sun Feb 23 14:29:44 2014 -0800 @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import os +import unittest +from textshaper.decorator import lines + +class TestDecorators(unittest.TestCase): + """test decorator(s) for textshaper""" + + def test_lines(self): + """test line decorator""" + + @lines + def upper_case(text): + return [line.upper() for line in text] + + content = """the quick brown fox +jumped over +the lazy dog""" + + _lines = content.splitlines() + + self.assertEqual(upper_case(content), """THE QUICK BROWN FOX +JUMPED OVER +THE LAZY DOG""") + self.assertEqual(upper_case(_lines), ["THE QUICK BROWN FOX", + "JUMPED OVER", + "THE LAZY DOG"]) + +if __name__ == '__main__': + unittest.main()