| 297 | >>> xmlref_path = os.path.join( |
---|
| 298 | ... os.path.dirname( |
---|
| 299 | ... os.path.abspath(__file__)), |
---|
| 300 | ... test_path, "xmlref") |
---|
| 301 | >>> ref_paths = sorted(glob.glob(os.path.join(test_path, "xmlref", |
---|
| 302 | ... "*", "*.ref"))) |
---|
| 303 | >>> xml_paths = sorted(glob.glob(os.path.join(xmldir, "*", "*.xml"))) |
---|
| 304 | >>> paths = zip(ref_paths, xml_paths) |
---|
| 305 | >>> truths = [] |
---|
| 306 | >>> for ref_path,xml_path in paths: |
---|
| 307 | ... ref_handle = open(ref_path) |
---|
| 308 | ... xml_handle = open(xml_path) |
---|
| 309 | ... reffile = ref_handle.read() |
---|
| 310 | ... xmlfile = xml_handle.read() |
---|
| 311 | ... ref_handle.close() |
---|
| 312 | ... xml_handle.close() |
---|
| 313 | ... truths.extend((reffile == xmlfile, |
---|
| 314 | ... os.path.exists(os.path.splitext(xml_path)[0]),)) |
---|
| 315 | >>> truths == [True, False,] * len(paths) |
---|
| 316 | True |
---|