Changeset 2ad8ea5 in flex_extract.git for python


Ignore:
Timestamp:
Aug 31, 2018, 2:32:09 PM (6 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
451bb19
Parents:
2f4cc73
Message:

added a test for function get_cmdline_arguments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/pythontest/TestTools.py

    r2f4cc73 r2ad8ea5  
    99sys.path.append('../')
    1010import _config
    11 from tools import init128, to_param_id, my_error, read_ecenv
     11from tools import (init128, to_param_id, my_error, read_ecenv,
     12                   get_cmdline_arguments)
    1213
    1314
     
    2021
    2122    def test_get_cmdline_arguments(self):
    22         assert True
     23        '''
     24        '''
     25        cmd_dict_control = {'start_date':'20180101',
     26                            'end_date':'20180101',
     27                            'date_chunk':'3',
     28                            'basetime':'12',
     29                            'step':'1',
     30                            'levelist':'1/to/10',
     31                            'area':'50/10/60/20',
     32                            'inputdir':'../work',
     33                            'outputdir':'../work',
     34                            'flexpart_root_scripts':'../',
     35                            'ppid':'1234',
     36                            'job_template':'job.sh',
     37                            'queue':'ecgate',
     38                            'controlfile':'CONTROL.WORK',
     39                            'debug':'1'}
     40
     41        sys.argv = ['dummy.py',
     42                    '--start_date=20180101',
     43                    '--end_date=20180101',
     44                    '--date_chunk=3',
     45                    '--basetime=12',
     46                    '--step=1',
     47                    '--levelist=1/to/10',
     48                    '--area=50/10/60/20',
     49                    '--inputdir=../work',
     50                    '--outputdir=../work',
     51                    '--flexpart_root_scripts=../',
     52                    '--ppid=1234',
     53                    '--job_template=job.sh',
     54                    '--queue=ecgate',
     55                    '--controlfile=CONTROL.WORK',
     56                    '--debug=1']
     57
     58        results = get_cmdline_arguments()
     59
     60        assert cmd_dict_control == vars(results)
    2361
    2462    def test_init128(self):
     
    3068        result = all((k in table128 and table128[k]==v) for k,v in expected.iteritems())
    3169        assert result == True
    32 
    3370
    3471    def test_to_param_id(self):
     
    6097        assert envs_ref == envs
    6198
    62 
    6399    def test_clean_up(self):
    64100        assert True
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG