Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Commit

Permalink
Updated tests for template paths releative to setup.py, not the tests…
Browse files Browse the repository at this point in the history
… folder.
  • Loading branch information
Alice Bevan-McGregor committed Feb 2, 2010
1 parent ca5ed27 commit daf3ff3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/test_engines.py
Expand Up @@ -54,13 +54,13 @@ def test_bad_engine_assignment(self):
def test_render(self):
render = Engines()

self.assertEqual(render('sprintf:./templates/hello-sprintf.txt', dict(name='world')), ('text/plain', "Hello world!"))
self.assertEqual(render('sprintf:./tests/templates/hello-sprintf.txt', dict(name='world')), ('text/plain', "Hello world!"))

def test_render_no_engine(self):
render = Engines()

try:
self.assertEqual(render('./templates/hello-sprintf.txt', dict(name='world')), ('text/plain', "Hello world!"))
self.assertEqual(render('./tests/templates/hello-sprintf.txt', dict(name='world')), ('text/plain', "Hello world!"))

except ValueError:
pass
Expand Down
10 changes: 5 additions & 5 deletions tests/test_templating.py
Expand Up @@ -19,15 +19,15 @@ def test_formatter_string(self):
('text/plain', 'Hello world!'))

def test_formatter_file(self):
self.assertEqual(self.render.formatter(dict(name="world"), './templates/hello-formatter.txt'),
self.assertEqual(self.render.formatter(dict(name="world"), './tests/templates/hello-formatter.txt'),
('text/plain', 'Hello world!'))

def test_sprintf_string(self):
self.assertEqual(self.render.sprintf(dict(name="world"), string="Hello %(name)s!"),
('text/plain', 'Hello world!'))

def test_sprintf_file(self):
self.assertEqual(self.render.sprintf(dict(name="world"), './templates/hello-sprintf.txt'),
self.assertEqual(self.render.sprintf(dict(name="world"), './tests/templates/hello-sprintf.txt'),
('text/plain', 'Hello world!'))

def test_template_string(self):
Expand All @@ -39,7 +39,7 @@ def test_template_string_unsafe(self):
('text/plain', 'Hello world!'))

def test_template_file(self):
self.assertEqual(self.render.template(dict(name="world"), './templates/hello-template.txt'),
self.assertEqual(self.render.template(dict(name="world"), './tests/templates/hello-template.txt'),
('text/plain', 'Hello world!'))


Expand All @@ -48,11 +48,11 @@ def setUp(self):
self.render = Engines()

def test_mako(self):
self.assertEqual(self.render.mako(dict(name="world"), './templates/hello-mako.txt', content_type='text/plain'),
self.assertEqual(self.render.mako(dict(name="world"), './tests/templates/hello-mako.txt', content_type='text/plain'),
('text/plain', u'Hello world!'))

def test_cheetah(self):
self.assertEqual(self.render.cheetah(dict(name="world"), './templates/hello-cheetah.tmpl', content_type='text/plain'),
self.assertEqual(self.render.cheetah(dict(name="world"), './tests/templates/hello-cheetah.tmpl', content_type='text/plain'),
('text/plain', u'Hello world!\n'))


Expand Down

0 comments on commit daf3ff3

Please sign in to comment.