diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-03-23 21:11:02 -0700 |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-03-23 21:11:02 -0700 |
commit | 4260e313f56b242ad91cb93093c4a5fa2c64553c (patch) | |
tree | de6add826f87dc10da597b03e3fd7a49b86cc37d | |
parent | a27c29158c9a8fe1c03abc9cc715a5f304c93ab7 (diff) | |
download | pystache-4260e313f56b242ad91cb93093c4a5fa2c64553c.tar.gz |
Added a Loader test case (template attribute).
-rw-r--r-- | pystache/custom_template.py | 2 | ||||
-rw-r--r-- | tests/common.py | 1 | ||||
-rw-r--r-- | tests/test_custom_template.py | 8 |
3 files changed, 8 insertions, 3 deletions
diff --git a/pystache/custom_template.py b/pystache/custom_template.py index a16e49a..52435e7 100644 --- a/pystache/custom_template.py +++ b/pystache/custom_template.py @@ -13,7 +13,7 @@ from .reader import Reader from .renderer import Renderer -# TODO: rename this to Template? +# TODO: consider renaming this to something like Template or TemplateInfo. class CustomizedTemplate(object): """ diff --git a/tests/common.py b/tests/common.py index 467f9af..f345630 100644 --- a/tests/common.py +++ b/tests/common.py @@ -14,6 +14,7 @@ def get_data_path(file_name): return os.path.join(DATA_DIR, file_name) +# TODO: convert this to a mixin. def assert_strings(test_case, actual, expected): # Show both friendly and literal versions. message = """\ diff --git a/tests/test_custom_template.py b/tests/test_custom_template.py index 71b8e5d..ee4b8c8 100644 --- a/tests/test_custom_template.py +++ b/tests/test_custom_template.py @@ -142,6 +142,11 @@ class LoaderTests(unittest.TestCase, AssertIsMixin): """ + def assertString(self, actual, expected): + # TODO: use the assertStrings mixin. + self.assertEquals(type(actual), type(expected)) + self.assertEquals(actual, expected) + def test_init__defaults(self): loader = Loader() @@ -184,8 +189,7 @@ class LoaderTests(unittest.TestCase, AssertIsMixin): template.template = "abc" loader = Loader() - self.assertEquals(loader.load(template), "wxy") - + self.assertString(loader.load(template), u"abc") # TODO: migrate these tests into the LoaderTests class. |