Trees | Indices | Help |
---|
|
1 # Test that the ParseRecords object produces the same code as the 2 # underlying expression. 3 4 from xml.sax import handler, saxutils 5 from cStringIO import StringIO 6 import Martel 7 from testformats import swissprot38 8 9 import test_swissprot38 10 11 text = test_swissprot38.record1 + test_swissprot38.record2 1214 s1 = StringIO() 15 parser = swissprot38.format_expression.make_parser() 16 parser.setErrorHandler(handler.ErrorHandler()) 17 parser.setContentHandler(saxutils.XMLGenerator(s1)) 18 parser.parseString(text) 19 20 s2 = StringIO() 21 parser = swissprot38.format.make_parser() 22 parser.setErrorHandler(handler.ErrorHandler()) 23 parser.setContentHandler(saxutils.XMLGenerator(s2)) 24 parser.parseString(text) 25 26 s3 = StringIO() 27 parser = swissprot38.format.expression.make_parser() 28 parser.setErrorHandler(handler.ErrorHandler()) 29 parser.setContentHandler(saxutils.XMLGenerator(s3)) 30 parser.parseString(text) 31 32 assert s1.getvalue() == s2.getvalue() == s3.getvalue()33 34 if __name__ == "__main__": 35 test() 36
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sun May 3 15:54:04 2009 | http://epydoc.sourceforge.net |