def api_process(r, comment=None, trace=False, saved=None, expect=None): try: if saved: r = fetch_saved(saved) if expect: assert expect == r.type return r except IOError: pass ans = r.send() f = writenext() if comment: f.write('<!-- %s -->\n' % comment) f.write(ans.__repr__(recursive=True,multiline=True)) r = Result.parse(ans, engine=e) if expect: assert expect == r.type return r
def api_process(r, comment=None, trace=False, saved=None, expect=None): try: if saved: r = fetch_saved(saved) if expect: assert expect == r.type return r except IOError: pass ans = r.send() f = writenext() if comment: f.write('<!-- %s -->\n' % comment) f.write(ans.__repr__(recursive=True, multiline=True)) r = Result.parse(ans, engine=e) if expect: assert expect == r.type return r
def fetch_saved(idx): f = open('test/%s.xml' % idx) r = Result.parse(f.read(), engine=e) return r