validate for kristina's test suite

This commit is contained in:
Mike Dirolf 2009-01-09 17:16:37 -05:00
parent 99d45eadf9
commit 7abffdffb2
2 changed files with 22 additions and 0 deletions

3
validate Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
python validate.py $1 $2

19
validate.py Normal file
View File

@ -0,0 +1,19 @@
import sys
from bson import BSON
from son import SON
def main():
xml_file = sys.argv[1]
out_file = sys.argv[2]
f = open(xml_file, "r")
xml = f.read()
f.close()
f = open(out_file, "w")
f.write(BSON.from_dict(SON.from_xml(xml)))
f.close()
if __name__ == "__main__":
main()