Mercurial > genshi > genshi-test
changeset 568:8f0d601afc0c
AST transformer needs to also handle the class body.
author | cmlenz |
---|---|
date | Sat, 14 Jul 2007 08:56:20 +0000 |
parents | aa8e85a4085e |
children | 4cbd8031ed76 |
files | genshi/template/eval.py genshi/template/tests/eval.py |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/genshi/template/eval.py +++ b/genshi/template/eval.py @@ -443,7 +443,7 @@ def visitClass(self, node): return self._clone(node, node.name, [self.visit(x) for x in node.bases], - node.doc, node.code + node.doc, self.visit(node.code) ) def visitFunction(self, node):
--- a/genshi/template/tests/eval.py +++ b/genshi/template/tests/eval.py @@ -457,6 +457,15 @@ suite.execute(data) assert 'plain' in data + def test_class_with_methods(self): + suite = Suite("""class plain(object): + def donothing(): + pass +""") + data = {} + suite.execute(data) + assert 'plain' in data + def test_import(self): suite = Suite("from itertools import ifilter") data = {}