- def run_auto_test(self, in_data, out_data):
- info = dcparser.BookInfo.from_string(in_data).to_dict()
- should_be = eval(out_data)
- for key in should_be:
- self.assertEqual( info[key], should_be[key] )
+def check_dcparser(xml_file, result_file):
+ xml = file(xml_file).read()
+ result = codecs.open(result_file, encoding='utf-8').read()
+ info = dcparser.BookInfo.from_string(xml).to_dict()
+ should_be = eval(result)
+ for key in should_be:
+ assert_equals(info[key], should_be[key])