Changeset 222aa11 in flex_extract.git for python/pythontest/TestTools.py


Ignore:
Timestamp:
Sep 10, 2018, 8:54:42 AM (17 months ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
dev
Children:
3232589
Parents:
308e144
Message:

added pathes in config file and according testcases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/pythontest/TestTools.py

    r308e144 r222aa11  
    2424
    2525    def test_get_cmdline_arguments(self):
    26         '''
    27         '''
    2826        cmd_dict_control = {'start_date':'20180101',
    2927                            'end_date':'20180101',
     
    6462
    6563    def test_init128(self):
    66         '''
    67         '''
    6864        table128 = init128(_config.PATH_GRIBTABLE)
    6965        expected = {'078': 'TCLW', '130': 'T', '034': 'SST'}
     
    7369
    7470    def test_to_param_id(self):
    75         '''
    76         '''
    7771        table128 = init128(_config.PATH_GRIBTABLE)
    7872        pars = to_param_id("T/SP/LSP/SSHF", table128)
     
    8175
    8276    def test_my_error(self):
    83         '''
    84         '''
    8577        with pytest.raises(SystemExit) as pytest_wrapped_e:
    8678            my_error(['${USER}', 'anne.philipp@univie.ac.at'], 'Failed!')
     
    8981
    9082    def test_read_ecenv(self):
    91         '''
    92         '''
    9383        envs_ref = {'ECUID': 'km4a',
    9484                    'ECGID': 'at',
     
    10191
    10292    def test_clean_up(self):
     93
    10394        assert True
    10495
     
    123114        assert os.path.isfile(testfile) == False
    124115        assert out == ''
    125 #
    126 #    def test_failany_silent_remove(self):
    127 #        testfile = 'testfileany.test'
    128 #        with pytest.raises(OSError) as pytest_wrapped_e:
    129 #            silent_remove(testfile)
    130 #        #out, err = capfd.readouterr()
    131 #        #assert os.path.isfile(testfile) == False
    132 #        #assert out == ''
    133116
    134     def test_get_list_as_string(self):
    135         assert True
     117    @pytest.mark.skip(reason="no way of currently testing this")
     118    def test_failany_silent_remove(self):
     119        testfile = 'testfileany.test'
     120        with pytest.raises(OSError) as pytest_wrapped_e:
     121            silent_remove(testfile)
     122        #out, err = capfd.readouterr()
     123        #assert os.path.isfile(testfile) == False
     124        #assert out == ''
     125
     126    def test_success_get_list_as_string(self):
     127        list_object =  [1, 2, 3, '...', 'testlist']
     128        list_as_string = '1, 2, 3, ..., testlist'
     129        assert list_as_string == get_list_as_string(list_object)
     130
     131    @pytest.mark.skip(reason="no way of currently testing this")
     132    def test_fail_get_list_as_string(self):
     133        list_object =  [1, 2, 3, '...', 'testlist']
     134        list_as_string = '1, 2, 3, ..., testlist'
     135        with pytest.raises(Exception) as pytest_wrapped_e:
     136            result = get_list_as_string(list_object)
     137        assert result == list_as_string
    136138
    137139    def test_warningexist_make_dir(self, capfd):
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG