Changeset 366
- Timestamp:
- 09/02/10 13:44:18
- Files:
-
- spongenet/trunk/spongenet/parse.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spongenet/trunk/spongenet/parse.py
r351 r366 140 140 def xmldoc(path): 141 141 """ 142 Return the XML document as a list of stringsfrom a file at path.142 Return the XML document as a string from a file at path. 143 143 144 144 Get the test reference data. … … 164 164 Verify the test document matches the reference data. 165 165 166 >>> _xmldoc [0] == '<?xml version="1.0" encoding="utf-8"?>\\n'167 True 168 >>> _xmldoc [-1] == '</root>\\n'169 True 170 >>> len(_xmldoc ) == xml_doc_lens[os.path.basename(_xmldoc_path)]166 >>> _xmldoc.splitlines()[0] == '<?xml version="1.0" encoding="utf-8"?>' 167 True 168 >>> _xmldoc.splitlines()[-1] == '</root>' 169 True 170 >>> len(_xmldoc.splitlines()) == xml_doc_lens[os.path.basename(_xmldoc_path)] 171 171 True 172 172 >>> doc_hash = hashlib.md5() 173 >>> doc_hash.update( "".join(_xmldoc))173 >>> doc_hash.update(_xmldoc) 174 174 >>> doc_hash.hexdigest() == xml_doc_md5s[os.path.basename(_xmldoc_path)] 175 175 True … … 180 180 _xmldoc = handle.readlines() 181 181 182 return _xmldoc182 return "".join(_xmldoc) 183 183 184 184