Changeset 54a8a01 in flex_extract.git for pythontest
- Timestamp:
- Aug 31, 2018, 7:50:37 AM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 597d4d1
- Parents:
- e1228f3
- Location:
- pythontest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pythontest/TestTools.py
refdb01a r54a8a01 4 4 import unittest 5 5 import sys 6 import os 6 7 sys.path.append('../python') 7 from Tools import init128, toparamId8 from tools import init128, to_param_id, my_error, read_ecenv 8 9 9 10 … … 25 26 26 27 27 def test_to paramId(self):28 def test_to_param_id(self): 28 29 ''' 29 30 ''' 30 31 table128 = init128('../grib_templates/ecmwf_grib1_table_128') 31 pars = to paramId("T/SP/LSP/SSHF", table128)32 pars = to_param_id("T/SP/LSP/SSHF", table128) 32 33 for par in pars: 33 34 self.assertIn(par, [130, 134, 142, 146]) 35 36 def test_error_notifcation(self): 37 ''' 38 ''' 39 with self.assertRaises(SystemExit) as re: 40 my_error(['${USER}', 'anne.philipp@univie.ac.at'], 'Failed!') 41 self.assertEqual(re.exception.code, 1) 42 43 def test_read_ecenv(self): 44 45 envs_ref = {'ECUID': 'km4a', 46 'ECGID': 'at', 47 'GATEWAY': 'srvx8.img.univie.ac.at', 48 'DESTINATION': 'annep@genericSftp' 49 } 50 envs = read_ecenv(os.getcwd() + '/TestData/ECMWF_ENV') 51 52 self.assertDictEqual(envs_ref, envs) 53 54 55 34 56 35 57 -
pythontest/TestUIOFiles.py
refdb01a r54a8a01 6 6 import sys 7 7 sys.path.append('../python') 8 import U IOFiles8 import UioFiles 9 9 10 10 11 class TestU IOFiles(unittest.TestCase):11 class TestUioFiles(unittest.TestCase): 12 12 ''' 13 13 Test class to test the UIOFiles methods. … … 52 52 53 53 # Initialise and collect filenames 54 files = U IOFiles.UIOFiles(['.grb'])55 files.list Files(self.testpath, '*')54 files = UioFiles.UioFiles(['.grb']) 55 files.list_files(self.testpath, '*') 56 56 # get the basename to just check for equality of filenames 57 57 filelist = [os.path.basename(f) for f in files.files]
Note: See TracChangeset
for help on using the changeset viewer.