Skip to content
Snippets Groups Projects
Commit 2ad8ea53 authored by Anne Philipp's avatar Anne Philipp
Browse files

added a test for function get_cmdline_arguments

parent 2f4cc733
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,8 @@ import pytest
sys.path.append('../')
import _config
from tools import init128, to_param_id, my_error, read_ecenv
from tools import (init128, to_param_id, my_error, read_ecenv,
get_cmdline_arguments)
class TestTools():
......@@ -19,7 +20,44 @@ class TestTools():
pass
def test_get_cmdline_arguments(self):
assert True
'''
'''
cmd_dict_control = {'start_date':'20180101',
'end_date':'20180101',
'date_chunk':'3',
'basetime':'12',
'step':'1',
'levelist':'1/to/10',
'area':'50/10/60/20',
'inputdir':'../work',
'outputdir':'../work',
'flexpart_root_scripts':'../',
'ppid':'1234',
'job_template':'job.sh',
'queue':'ecgate',
'controlfile':'CONTROL.WORK',
'debug':'1'}
sys.argv = ['dummy.py',
'--start_date=20180101',
'--end_date=20180101',
'--date_chunk=3',
'--basetime=12',
'--step=1',
'--levelist=1/to/10',
'--area=50/10/60/20',
'--inputdir=../work',
'--outputdir=../work',
'--flexpart_root_scripts=../',
'--ppid=1234',
'--job_template=job.sh',
'--queue=ecgate',
'--controlfile=CONTROL.WORK',
'--debug=1']
results = get_cmdline_arguments()
assert cmd_dict_control == vars(results)
def test_init128(self):
'''
......@@ -30,7 +68,6 @@ class TestTools():
result = all((k in table128 and table128[k]==v) for k,v in expected.iteritems())
assert result == True
def test_to_param_id(self):
'''
'''
......@@ -59,7 +96,6 @@ class TestTools():
assert envs_ref == envs
def test_clean_up(self):
assert True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment