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

renamed documentation dir; moved pythontest to python dir

parent 597d4d13
No related branches found
No related tags found
No related merge requests found
Showing
with 286 additions and 0 deletions
File added
File added
File added
File added
File added
File added
File added
DAY1
DAY2
DTIME 3
TYPE AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC
TIME 00 00 00 00 00 00 06 00 00 00 00 00 12 12 12 12 12 12 18 12 12 12 12 12
STEP 00 01 02 03 04 05 00 07 08 09 10 11 00 01 02 03 04 05 00 07 08 09 10 11
CLASS EI
STREAM OPER
NUMBER OFF
EXPVER 1
GRID 5000
LEFT -15000
LOWER 30000
UPPER 75000
RIGHT 45000
LEVEL 60
LEVELIST 55/to/60
RESOL 63
GAUSS 1
ACCURACY 16
OMEGA 0
OMEGADIFF 0
ETA 0
ETADIFF 0
DPDETA 1
SMOOTH 0
FORMAT GRIB1
ADDPAR 186/187/188/235/139/39
PREFIX EI
ECSTORAGE 0
ECTRANS 1
ECFSDIR ectmp:/${USER}/econdemand/
MAILFAIL ${USER}
MAILOPS ${USER}
GRIB2FLEXPART 0
EOF
ECUID km4a
ECGID at
GATEWAY srvx8.img.univie.ac.at
DESTINATION annep@genericSftp
File added
File added
File added
File added
File added
File added
File added
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import sys
import EcFlexpart
sys.path.append('../python')
class TestEcFlexpart(unittest.TestCase):
'''
'''
def setUp(self):
pass
def test__init__():
# create an instance of EcFlexpart and get a dictionary of the
# class attributes, compare this dict with an expected dict!
return
def test_write_namelist():
# simple
return
def test_retrieve():
# not sure how to check
return
# these functions should test the output and compare the results with an output
# of the old version and check if there are no differences!!!
# also check for errors?! Or check if it works for alle datasets and private public etc
# - process_output
# - create
# - deacc_fluxes
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import os
import sys
sys.path.append('../python')
from ControlFile import ControlFile
import tools
class TestInput(unittest.TestCase):
'''
Test class to test the reading of commandline arguments and
control file.
'''
# ToDo
# create more tests for input
# 1. nur controlfile reading
# 2. check of parameter
def setUp(self):
'''
'''
# Default values for ArgumentParser
self.args = {'start_date':None,
'end_date':None,
'date_chunk':None,
'basetime':None,
'step':None,
'levelist':None,
'area':None,
'inputdir':None,
'outputdir':None,
'flexpart_root_scripts':None,
'ppid':None,
'job_template':'job.temp',
'queue':None,
'controlfile':'CONTROL.temp',
'debug':0,
}
#sys.argv = ['dummy.py', '--start_date=20180101', '--debug=1',
# '--step=0/to/11/BY/3', '--area=20./20./0./90.']
sys.argv = ['dummy.py', '--start_date=20180101']
self.args = tools.get_commandline_arguments()
self.c = ControlFile('TestData/CONTROL.temp')
self.c.assign_args_to_control(self.args)
self.c.check_conditions()
return
def test_args_reading(self):
sys.argv = ['dummy.py', '--start_date=20180101', '--debug=1',
'--step=0/to/11/BY/3', '--area=20./20./0./90.']
arguments = tools.get_commandline_arguments()
args_exp = {'start_date':'20180101',
'end_date':None,
'date_chunk':None,
'basetime':None,
'step':'0/to/11/BY/3',
'levelist':None,
'area':'20./20./0./90.',
'inputdir':None,
'outputdir':None,
'flexpart_root_scripts':None,
'ppid':None,
'job_template':'job.temp',
'queue':None,
'controlfile':'CONTROL.temp',
'debug':1,
}
self.assertDictEqual(vars(arguments), args_exp)
return
def test_args_assignment(self):
import collections
# expected parametervalue:
exp_dict = {
'accuracy': '16',
'addpar': ['186', '187', '188', '235', '139', '39'],
'area': None,
'basetime': None,
'controlfile': 'CONTROL.temp',
'cwc': 0,
'date_chunk': 3,
'debug': 0,
'destination': None,
'dpdeta': '1',
'dtime': '3',
'ecfsdir': 'ectmp:/${USER}/econdemand/',
'ecgid': None,
'ecmwfdatadir': '/raid60/nas/tmc/Anne/Interpolation/flexextract/flexextract/python/../',
'ecstorage': '0',
'ectrans': '1',
'ecuid': None,
'end_date': '20180101',
'eta': '0',
'etadiff': '0',
'etapar': 77,
'exedir': '/raid60/nas/tmc/Anne/Interpolation/flexextract/flexextract/python/../src/',
'expver': '1',
'flexpart_root_scripts': '/raid60/nas/tmc/Anne/Interpolation/flexextract/flexextract/python/../',
'format': 'GRIB1',
'gateway': None,
'gauss': '1',
'grib2flexpart': '0',
'grid': '5000',
'inputdir': '../work',
'job_template': 'job.temp',
'left': '-15000',
'level': '60',
'levelist': '55/to/60',
'lower': '30000',
'mailfail': ['${USER}'],
'mailops': ['${USER}'],
'makefile': None,
'marsclass': 'EI',
'maxstep': 11,
'number': 'OFF',
'omega': '0',
'omegadiff': '0',
'outputdir': '../work',
'prefix': 'EI',
'resol': '63',
'right': '45000',
'smooth': '0',
'start_date': '20180101',
'step': ['00', '01', '02', '03', '04', '05', '00', '07', '08', '09', '10', '11', '00', '01', '02', '03', '04', '05', '00', '07', '08', '09', '10', '11'],
'stream': 'OPER',
'target': None,
'time': ['00', '00', '00', '00', '00', '00', '06', '00', '00', '00', '00', '00', '12', '12', '12', '12', '12', '12', '18', '12', '12', '12', '12', '12'],
'type': ['AN', 'FC', 'FC', 'FC', 'FC', 'FC', 'AN', 'FC', 'FC', 'FC', 'FC', 'FC', 'AN', 'FC', 'FC', 'FC', 'FC', 'FC', 'AN', 'FC', 'FC', 'FC', 'FC', 'FC'],
'upper': '75000',
'wrf': 0}
exp_dict = collections.OrderedDict(sorted(exp_dict.items()))
cdict = collections.OrderedDict(sorted(vars(self.c).items()))
# remove content which isn't comparable for different users
# or different operating systems
del cdict['ecfsdir_expanded']
del cdict['mailops_expanded']
del cdict['mailfail_expanded']
#print 'cdict\n', cdict
#print 'exp_dict\n', exp_dict
#assert cdict == exp_dict
self.assertDictEqual(cdict, exp_dict)
return
if __name__ == "__main__":
unittest.main()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import sys
import os
import inspect
sys.path.append('../python')
import install
class TestTools(unittest.TestCase):
'''
'''
def setUp(self):
pass
def test_mk_tarball(self):
ecd = os.path.dirname(os.path.abspath(inspect.getfile(
inspect.currentframe()))) + '/../'
#print ecd
install.mk_tarball(ecd)
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
def test_vtable():
print "vtable test"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment