Changeset 54a8a01 in flex_extract.git for pythontest/TestTools.py
- Timestamp:
- Aug 31, 2018, 7:50:37 AM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 597d4d1
- Parents:
- e1228f3
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.