Commit ee07ff5a by Chris Jerdonek

Some updates to the test code for moving the examples folder.

parent be685f38
...@@ -7,10 +7,9 @@ Provides test-related code that can be used by all tests. ...@@ -7,10 +7,9 @@ Provides test-related code that can be used by all tests.
import os import os
import examples
import pystache import pystache
from pystache import defaults from pystache import defaults
from pystache.tests import examples
# Save a reference to the original function to avoid recursion. # Save a reference to the original function to avoid recursion.
_DEFAULT_TAG_ESCAPE = defaults.TAG_ESCAPE _DEFAULT_TAG_ESCAPE = defaults.TAG_ESCAPE
......
...@@ -14,7 +14,7 @@ import unittest ...@@ -14,7 +14,7 @@ import unittest
from pystache.loader import Loader as Reader from pystache.loader import Loader as Reader
from pystache.locator import Locator from pystache.locator import Locator
from pystache.tests.common import DATA_DIR from pystache.tests.common import DATA_DIR, EXAMPLES_DIR
from pystache.tests.data.views import SayHello from pystache.tests.data.views import SayHello
...@@ -78,13 +78,13 @@ class LocatorTests(unittest.TestCase): ...@@ -78,13 +78,13 @@ class LocatorTests(unittest.TestCase):
def test_find_name(self): def test_find_name(self):
locator = Locator() locator = Locator()
path = locator.find_name(search_dirs=['examples'], template_name='simple') path = locator.find_name(search_dirs=[EXAMPLES_DIR], template_name='simple')
self.assertEqual(os.path.basename(path), 'simple.mustache') self.assertEqual(os.path.basename(path), 'simple.mustache')
def test_find_name__using_list_of_paths(self): def test_find_name__using_list_of_paths(self):
locator = Locator() locator = Locator()
path = locator.find_name(search_dirs=['doesnt_exist', 'examples'], template_name='simple') path = locator.find_name(search_dirs=[EXAMPLES_DIR, 'doesnt_exist'], template_name='simple')
self.assertTrue(path) self.assertTrue(path)
......
...@@ -45,7 +45,7 @@ class ViewTestCase(unittest.TestCase, AssertStringMixin): ...@@ -45,7 +45,7 @@ class ViewTestCase(unittest.TestCase, AssertStringMixin):
self.assertRaises(IOError, renderer.render, view) self.assertRaises(IOError, renderer.render, view)
# TODO: change this test to remove the following brittle line. # TODO: change this test to remove the following brittle line.
view.template_rel_directory = "../../examples" view.template_rel_directory = "examples"
actual = renderer.render(view) actual = renderer.render(view)
self.assertEqual(actual, "No tags...") self.assertEqual(actual, "No tags...")
......
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