[testlib] fix pb. related to class scoped variables
--- 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 = ()