diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-04-14 10:26:21 -0700 |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-04-14 10:26:21 -0700 |
commit | 0db070487943ad43bed2122ab57283f8a479799d (patch) | |
tree | 8143cdeb43af8d4b718a2586b1f60f557d473a2c /pystache/tests/test_specloader.py | |
parent | eacbdb3b6dacfbd86be9c07f18cedb2e3611a071 (diff) | |
download | pystache-0db070487943ad43bed2122ab57283f8a479799d.tar.gz |
Stubbed out a stand-alone script command.
The eventual goal is to have a test script that behaves well with tox.
Using a stand-alone test script that we control instead of an
out-of-the-box command-line script like nosetests or Distribute's test
should give us more flexibility in dealing with any idiosyncracies
that occur with tox.
Diffstat (limited to 'pystache/tests/test_specloader.py')
-rw-r--r-- | pystache/tests/test_specloader.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/pystache/tests/test_specloader.py b/pystache/tests/test_specloader.py index ac32dd6..6fc2256 100644 --- a/pystache/tests/test_specloader.py +++ b/pystache/tests/test_specloader.py @@ -19,10 +19,8 @@ from pystache import TemplateSpec from pystache.locator import Locator from pystache.loader import Loader from pystache.specloader import SpecLoader -from pystache.tests.common import DATA_DIR -from pystache.tests.common import EXAMPLES_DIR -from pystache.tests.common import AssertIsMixin -from pystache.tests.common import AssertStringMixin +from pystache.tests.common import DATA_DIR, EXAMPLES_DIR +from pystache.tests.common import AssertIsMixin, AssertStringMixin from pystache.tests.data.views import SampleView from pystache.tests.data.views import NonAscii @@ -358,6 +356,13 @@ class TemplateSpecTests(unittest.TestCase): view.template_extension = 'txt' self._assert_template_location(view, (None, 'sample_view.txt')) + def _assert_paths(self, actual, expected): + """ + Assert that two paths are the same. + + """ + self.assertEqual(actual, expected) + def test_find__with_directory(self): """ Test _find() with a view that has a directory specified. @@ -370,9 +375,9 @@ class TemplateSpecTests(unittest.TestCase): self.assertTrue(loader._find_relative(view)[0] is not None) actual = loader._find(view) - expected = os.path.abspath(os.path.join(DATA_DIR, 'foo/bar.txt')) + expected = os.path.join(DATA_DIR, 'foo/bar.txt') - self.assertEqual(actual, expected) + self._assert_paths(actual, expected) def test_find__without_directory(self): """ @@ -385,9 +390,9 @@ class TemplateSpecTests(unittest.TestCase): self.assertTrue(loader._find_relative(view)[0] is None) actual = loader._find(view) - expected = os.path.abspath(os.path.join(DATA_DIR, 'sample_view.mustache')) + expected = os.path.join(DATA_DIR, 'sample_view.mustache') - self.assertEqual(actual, expected) + self._assert_paths(actual, expected) def _assert_get_template(self, custom, expected): loader = self._make_loader() |