def parseExpected(expected_text):
 expected = []
 if expected_text:
  for chunk in expected_text.split(','):
   chunk = chunk.strip()
   (mtype, qstuff) = chunk.split(';')
   mtype = mtype.strip()
   assert ('/' in mtype)
   qstuff = qstuff.strip()
   (q, qstr) = qstuff.split('=')
   assert (q == 'q')
   qval = float(qstr)
   expected.append((mtype, qval))
 return expected

def parseExpected ( expected_text ) : expected = [ ] if expected_text : for chunk in expected_text . split ( ',' ) : chunk = chunk . strip ( ) ( mtype , qstuff ) = chunk . split ( ';' ) mtype = mtype . strip ( ) assert ( '/' in mtype ) qstuff = qstuff . strip ( ) ( q , qstr ) = qstuff . split ( '=' ) assert ( q == 'q' ) qval = float ( qstr ) expected . append ( ( mtype , qval ) ) return expected
parse an expected: lines data str -> [] .