Ignore:
Timestamp:
Dec 19, 2019, 7:37:03 PM (4 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
0d99607
Parents:
4421b17
Message:

added Readme to tests; changed directory structure; added recent test results;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Testing/Regression/Mars_request/test_cmp_mars_requests.py

    • Property mode changed from 100644 to 100755
    r2d1c338 rbe6c0a2  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22# -*- coding: utf-8 -*-
    33"""Comparison of the created MARS requests of two flex_extract versions.
     
    3939from datetime import datetime
    4040
    41 sys.path.append('../../../source/python')
     41sys.path.append('../../../Source/Python')
    4242import _config
    43 from  mods.tools import init128
     43from  Mods.tools import init128
    4444
    4545# ------------------------------------------------------------------------------
     
    137137        else:
    138138            err_msg += 'Unconsistency happend to be in column: ' + col + '\n'
    139             print mr_new[col]
    140             print mr_old[col]
     139            print("THERE SEEMS TO BE AN ERROR:")
     140            print("CONTENT OF NEW VERSION:")
     141            print(mr_new[col])
     142            print("CONTENT OF OLD VERSION:")
     143            print(mr_old[col])
    141144            return False
    142145    return lresult
     
    186189           
    187190            nsteps = str(int(steps[1]))+'/to/'+str(int(steps[-1]))+'/by/'+str(int(dtime))
    188             return nsteps
    189            
     191            return nsteps           
    190192   
    191193    return mr_old
     
    252254    time_str = currenttime.strftime('%Y-%m-%d_%H-%M-%S')
    253255    logfile = os.path.join(log_path, 'log_' + time_str)
    254     with open(logfile, 'aw') as f:
     256    with open(logfile, 'a') as f:
    255257        f.write('Compare mars requests between version ' + old_dir +
    256258                ' and version ' + new_dir + ' : \n')
     
    288290        mr_old['param'] = mr_old['param'].apply(to_param_id, args=[table128])
    289291        mr_old['number'] = mr_old['number'].apply(convert_param_numbers) 
    290         if '142' in mr_old.ix[0,'param']: # if flux request
    291             mr_old.ix[0,'step'] = convert_param_step(mr_old.ix[0,'step'])
    292 
    293         print 'Results: ', c
     292        if '142' in mr_old.loc[0,'param']: # if flux request
     293            mr_old.loc[0,'step'] = convert_param_step(mr_old.loc[0,'step'])
     294
     295        print('Results: ', c)
    294296
    295297        # do tests on mr files
     
    302304
    303305        # write out result to logging file
    304         with open(logfile, 'aw') as f:
     306        with open(logfile, 'a') as f:
    305307            if lcoleq and lnoeq and lcoeq:
    306308                f.write('... ' + c + ' ... OK!' + '\n')
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG