Changeset 54a8a01 in flex_extract.git for pythontest/TestTools.py


Ignore:
Timestamp:
Aug 31, 2018, 7:50:37 AM (6 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
597d4d1
Parents:
e1228f3
Message:

restructuring, documentations and bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pythontest/TestTools.py

    refdb01a r54a8a01  
    44import unittest
    55import sys
     6import os
    67sys.path.append('../python')
    7 from Tools import init128, toparamId
     8from tools import init128, to_param_id, my_error, read_ecenv
    89
    910
     
    2526
    2627
    27     def test_toparamId(self):
     28    def test_to_param_id(self):
    2829        '''
    2930        '''
    3031        table128 = init128('../grib_templates/ecmwf_grib1_table_128')
    31         pars = toparamId("T/SP/LSP/SSHF", table128)
     32        pars = to_param_id("T/SP/LSP/SSHF", table128)
    3233        for par in pars:
    3334            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
    3456
    3557
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG