diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-03-22 12:35:39 -0700 |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-03-22 12:35:39 -0700 |
commit | 78ac3e0d1081c1fbc64247bb1c1b67cab8bb6c71 (patch) | |
tree | c85f9d8942db5d24b3a7174722cd215348e57333 | |
parent | 5628daddb67c2b7086f0011cb96e593cd2079655 (diff) | |
download | pystache-78ac3e0d1081c1fbc64247bb1c1b67cab8bb6c71.tar.gz |
Separated LoaderTests into two test classes (as an interim step)..
-rw-r--r-- | tests/test_custom_template.py | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/tests/test_custom_template.py b/tests/test_custom_template.py index 18841bf..9c93a04 100644 --- a/tests/test_custom_template.py +++ b/tests/test_custom_template.py @@ -134,22 +134,12 @@ class ViewTestCase(unittest.TestCase): self.assertEquals(view.render(), """one, two, three, empty list""") -# TODO: switch these tests to using the CustomizedTemplate class instead of View. -# TODO: rename the get_template() tests to test load(). -# TODO: condense, reorganize, and rename the tests so that it is -# clear whether we have full test coverage (e.g. organized by -# CustomizedTemplate attributes or something). class LoaderTests(unittest.TestCase, AssertIsMixin): - # TODO: rename this method to _make_loader(). - def _make_locator(self): - locator = Loader(search_dirs=[DATA_DIR]) - return locator + """ + Tests the custom_template.Loader class. - def _assert_template_location(self, view, expected): - locator = self._make_locator() - actual = locator.get_relative_template_location(view) - self.assertEquals(actual, expected) + """ def test_init__defaults(self): loader = Loader([]) @@ -181,6 +171,25 @@ class LoaderTests(unittest.TestCase, AssertIsMixin): self.assertIs(loader.locator, locator) + +# TODO: migrate these tests into the LoaderTests class. +# TODO: switch these tests to using the CustomizedTemplate class instead of View. +# TODO: rename the get_template() tests to test load(). +# TODO: condense, reorganize, and rename the tests so that it is +# clear whether we have full test coverage (e.g. organized by +# CustomizedTemplate attributes or something). +class ViewTests(unittest.TestCase): + + # TODO: rename this method to _make_loader(). + def _make_locator(self): + locator = Loader(search_dirs=[DATA_DIR]) + return locator + + def _assert_template_location(self, view, expected): + locator = self._make_locator() + actual = locator.get_relative_template_location(view) + self.assertEquals(actual, expected) + def test_get_relative_template_location(self): """ Test get_relative_template_location(): default behavior (no attributes set). |