diff options
author | Chris Wanstrath <chris@ozmm.org> | 2009-11-12 19:22:51 -0800 |
---|---|---|
committer | Chris Wanstrath <chris@ozmm.org> | 2009-11-12 19:22:51 -0800 |
commit | d4f27953a6cd41d7c7427c4749f2cb1c7fc33a54 (patch) | |
tree | b89dbf03b3f3695732c823672dda437a58d6ce96 | |
parent | 1ac8a33d04d3289a67fb75d05f06ed13da433414 (diff) | |
download | pystache-d4f27953a6cd41d7c7427c4749f2cb1c7fc33a54.tar.gz |
Add `examples` test file, start with a comments test
-rw-r--r-- | examples/comments.mustache | 1 | ||||
-rw-r--r-- | examples/comments.py | 7 | ||||
-rw-r--r-- | tests/test_examples.py | 9 |
3 files changed, 17 insertions, 0 deletions
diff --git a/examples/comments.mustache b/examples/comments.mustache new file mode 100644 index 0000000..8bdfb5e --- /dev/null +++ b/examples/comments.mustache @@ -0,0 +1 @@ +<h1>{{title}}{{! just something interesting... #or not... }}</h1> diff --git a/examples/comments.py b/examples/comments.py new file mode 100644 index 0000000..1d2ed0b --- /dev/null +++ b/examples/comments.py @@ -0,0 +1,7 @@ +import pystache + +class Comments(pystache.View): + template_path = 'examples' + + def title(self): + return "A Comedy of Errors" diff --git a/tests/test_examples.py b/tests/test_examples.py new file mode 100644 index 0000000..070a814 --- /dev/null +++ b/tests/test_examples.py @@ -0,0 +1,9 @@ +import unittest +import pystache + +from examples.comments import Comments + +class TestView(unittest.TestCase): + def test_comments(self): + self.assertEquals(Comments().render(), """<h1>A Comedy of Errors</h1> +""") |