# 3) Verify the correctness of moreinfo transformations
try:
descriptions=cPickle.loads(run_sql("SELECT data_value FROM bibdocmoreinfo WHERE id_bibdoc=%s AND namespace=%s AND data_key=%s",(str(docid),'','descriptions'))[0][0])
forversioninminfo['descriptions']:
fordocformatinminfo['descriptions'][version]:
v1=descriptions[version][docformat]
v2=minfo['descriptions'][version][docformat]
ifv1!=v2:
are_equal=False
logger.info("ERROR: Document %s: Expected description %s and got %s"%(str(docid),str(v2),str(v1)))
exceptException,e:
logger.info("ERROR: Document %s: Problem with retrieving descriptions: %s MoreInfo: %s Descriptions: %s"%(str(docid),str(e),str(minfo),str(descriptions)))
try:
comments=cPickle.loads(run_sql("SELECT data_value FROM bibdocmoreinfo WHERE id_bibdoc=%s AND namespace=%s AND data_key=%s",(str(docid),'','comments'))[0][0])
forversioninminfo['comments']:
fordocformatinminfo['comments'][version]:
v1=comments[version][docformat]
v2=minfo['comments'][version][docformat]
ifv1!=v2:
are_equal=False
logger.info("ERROR: Document %s: Expected comment %s and got %s"%(str(docid),str(v2),str(v1)))
exceptException,e:
logger.info("ERROR: Document %s: Problem with retrieving comments: %s MoreInfo: %s Comments: %s"%(str(docid),str(e),str(minfo),str(comments)))
try:
flags=cPickle.loads(run_sql("SELECT data_value FROM bibdocmoreinfo WHERE id_bibdoc=%s AND namespace=%s AND data_key=%s",(str(docid),'','flags'))[0][0])