Commit 4260e313 by Chris Jerdonek

Added a Loader test case (template attribute).

parent a27c2915
...@@ -13,7 +13,7 @@ from .reader import Reader ...@@ -13,7 +13,7 @@ from .reader import Reader
from .renderer import Renderer from .renderer import Renderer
# TODO: rename this to Template? # TODO: consider renaming this to something like Template or TemplateInfo.
class CustomizedTemplate(object): class CustomizedTemplate(object):
""" """
......
...@@ -14,6 +14,7 @@ def get_data_path(file_name): ...@@ -14,6 +14,7 @@ def get_data_path(file_name):
return os.path.join(DATA_DIR, file_name) return os.path.join(DATA_DIR, file_name)
# TODO: convert this to a mixin.
def assert_strings(test_case, actual, expected): def assert_strings(test_case, actual, expected):
# Show both friendly and literal versions. # Show both friendly and literal versions.
message = """\ message = """\
......
...@@ -142,6 +142,11 @@ class LoaderTests(unittest.TestCase, AssertIsMixin): ...@@ -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): def test_init__defaults(self):
loader = Loader() loader = Loader()
...@@ -184,8 +189,7 @@ class LoaderTests(unittest.TestCase, AssertIsMixin): ...@@ -184,8 +189,7 @@ class LoaderTests(unittest.TestCase, AssertIsMixin):
template.template = "abc" template.template = "abc"
loader = Loader() loader = Loader()
self.assertEquals(loader.load(template), "wxy") self.assertString(loader.load(template), u"abc")
# TODO: migrate these tests into the LoaderTests class. # TODO: migrate these tests into the LoaderTests class.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment