def process_file_data(cls, name, func, file_attr):
 cls_path = os.path.abspath(inspect.getsourcefile(cls))
 data_file_path = os.path.join(os.path.dirname(cls_path), file_attr)
 def _raise_ve(*args):
  raise ValueError(('%s does not exist' % file_attr))
 if (os.path.exists(data_file_path) is False):
  test_name = mk_test_name(name, 'error')
  add_test(cls, test_name, _raise_ve, None)
 else:
  data = json.loads(open(data_file_path).read())
  for (i, elem) in enumerate(data):
   if isinstance(data, dict):
    (key, value) = (elem, data[elem])
    test_name = mk_test_name(name, key, i)
   elif isinstance(data, list):
    value = elem
    test_name = mk_test_name(name, value, i)
   if isinstance(value, dict):
    add_test(cls, test_name, func, **value)
   else:
    add_test(cls, test_name, func, value)

def process_file_data ( cls , name , func , file_attr ) : cls_path = os . path . abspath ( inspect . getsourcefile ( cls ) ) data_file_path = os . path . join ( os . path . dirname ( cls_path ) , file_attr ) def _raise_ve ( * args ) : raise ValueError ( ( '%s does not exist' % file_attr ) ) if ( os . path . exists ( data_file_path ) is False ) : test_name = mk_test_name ( name , 'error' ) add_test ( cls , test_name , _raise_ve , None ) else : data = json . loads ( open ( data_file_path ) . read ( ) ) for ( i , elem ) in enumerate ( data ) : if isinstance ( data , dict ) : ( key , value ) = ( elem , data [ elem ] ) test_name = mk_test_name ( name , key , i ) elif isinstance ( data , list ) : value = elem test_name = mk_test_name ( name , value , i ) if isinstance ( value , dict ) : add_test ( cls , test_name , func , ** value ) else : add_test ( cls , test_name , func , value )
process the parameter in the file_data decorator .