Changeset 0aaeb04 in flex_extract.git for source/pythontest/TestInstall.py


Ignore:
Timestamp:
Oct 8, 2018, 3:49:02 PM (6 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
0a06607
Parents:
0e576fc
Message:

added writing of compilejob and ECMWF_ENV via templates and added tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/pythontest/TestInstall.py

    r25b14be r0aaeb04  
    1111import _config
    1212import install
    13 from mods.tools import make_dir
     13from mods.tools import make_dir, silent_remove
    1414
    1515
     
    2424    #!    - mk_tarball
    2525    #!    - un_tarball
    26     #    - mk_env_vars
     26    #!    - mk_env_vars
    2727    #    - mk_compilejob
    2828    #    - mk_job_template
     
    116116        # clean up temp test dir
    117117        shutil.rmtree(test_dir)
     118
     119    def test_mk_env_vars(self):
     120        import filecmp
     121
     122        # comparison file
     123        testfile = os.path.join(_config.PATH_TEST_DIR,'TestData',
     124                                'ECMWF_ENV.test')
     125
     126        # create test ECMWF_ENV file
     127        install.mk_env_vars('testuser',
     128                            'testgroup',
     129                            'gateway.test.ac.at',
     130                            'user@destination')
     131
     132        assert filecmp.cmp(testfile, _config.PATH_ECMWF_ENV, shallow=False)
     133
     134        # delte test file
     135        silent_remove(_config.PATH_ECMWF_ENV)
     136
     137    def test_mk_compilejob(self):
     138        import filecmp
     139
     140        # comparison file
     141        testfile = os.path.join(_config.PATH_TEST_DIR,'TestData',
     142                                    'compilejob.test')
     143
     144        # create
     145        install.mk_compilejob('Makefile.TEST',
     146                              '',
     147                              'testuser',
     148                              'testgroup',
     149                              'fp_root_test_path')
     150
     151        finalfile = os.path.join(_config.PATH_JOBSCRIPTS,
     152                              _config.FILE_INSTALL_COMPILEJOB)
     153        assert filecmp.cmp(testfile, finalfile, shallow=False)
     154
     155        # delete test file
     156        silent_remove(finalfile)
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG