# HG changeset patch # User Aurelien Campeas # Date 1234198757 -3600 # Node ID a690996639caa0e2e1c12002e3a9d94e15b1ce95 # Parent bdadb26c4a3cf6163632baadac96cf767be13a75 [testlib] fix pb. related to class scoped variables diff -r bdadb26c4a3c -r a690996639ca devtools/testlib.py --- a/devtools/testlib.py Mon Feb 09 14:09:55 2009 +0100 +++ b/devtools/testlib.py Mon Feb 09 17:59:17 2009 +0100 @@ -78,6 +78,8 @@ return center - before <= line_no <= center + after ## base webtest class ######################################################### +VALMAP = {None: None, 'dtd': DTDValidator, 'xml': SaxOnlyValidator} + class WebTest(EnvBasedTC): """base class for web tests""" __abstract__ = True @@ -93,7 +95,6 @@ # SaxOnlyValidator : guarantees XML is well formed # None : do not try to validate anything # validators used must be imported from from.devtools.htmlparser - valmap = {None: None, 'dtd': DTDValidator, 'xml': SaxOnlyValidator} content_type_validators = { # maps MIME type : validator name # @@ -111,7 +112,7 @@ 'image/png': None, } # maps vid : validator name (override content_type_validators) - vid_validators = dict((vid, valmap[valkey]) + vid_validators = dict((vid, VALMAP[valkey]) for vid, valkey in VIEW_VALIDATORS.iteritems()) no_auto_populate = ()