From 7bf887c5bc311239cd3696ba1dc96cc233266b4c Mon Sep 17 00:00:00 2001 From: Lakshmi Vyasarajan Date: Mon, 20 Jun 2011 12:35:40 +0530 Subject: [PATCH] Added template test for tag metadata. (Issue #53) --- hyde/tests/ext/test_tagger.py | 71 ++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/hyde/tests/ext/test_tagger.py b/hyde/tests/ext/test_tagger.py index 75e199c..7da3b2d 100644 --- a/hyde/tests/ext/test_tagger.py +++ b/hyde/tests/ext/test_tagger.py @@ -32,7 +32,7 @@ class TestTagger(object): gen = Generator(self.s) gen.load_site_if_needed() gen.generate_all() - + assert hasattr(self.s, 'tagger') assert hasattr(self.s.tagger, 'tags') assert self.s.tagger.tags @@ -155,3 +155,72 @@ class TestTagger(object): tag = getattr(tags, tagname) assert tag assert not hasattr(tag, "emotions") + + def test_tagger_metadata(self): + conf = { + "tagger":{ + "sorter": "time", + "archives": { + "blog": { + "template": "emotions.j2", + "source": "blog", + "target": "blog/tags", + "extension": "html" + } + }, + "tags": { + "sad" : { + "emotions": ["Dissappointed", "Lost"] + }, + "angry": { + "emotions": ["Irritated", "Annoyed", "Disgusted"] + } + } + } + } + + text = """ +

Posts tagged: {{ tag }} in {{ node.name|title }}

+Emotions: +