Changeset c5074d2 in flex_extract.git for source/pythontest/TestEcFlexpart.py


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

added making of namelist file and jobscript via genshi templates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/pythontest/TestEcFlexpart.py

    r25b14be rc5074d2  
    44
    55import sys
     6import os
     7import inspect
    68import pytest
    79
    810sys.path.append('../python')
     11import _config
    912from classes.EcFlexpart import EcFlexpart
     13from classes.ControlFile import ControlFile
     14from mods.tools import silent_remove
    1015
    1116class TestEcFlexpart():
     
    1318    '''
    1419
    15     def test_init(self):
    16         # create an instance of EcFlexpart and get a dictionary of the
    17         # class attributes, compare this dict with an expected dict!
    18         assert True == True
     20    def test_write_namelist(self):
     21        import filecmp
    1922
    20     def test_write_namelist(self):
    21         # simple
    22         assert True == True
     23        control_file = os.path.join(_config.PATH_TEST_DIR,
     24                                        'TestData',
     25                                        'CONTROL.temp')
     26        c = ControlFile(control_file)
     27        flexpart = EcFlexpart(c)
     28
     29        c.inputdir = 'TestData'
     30
     31        # comparison file
     32        testfile = os.path.join(_config.PATH_TEST_DIR,
     33                                'TestData',
     34                                'convert.nl.test')
     35
     36        # create
     37        flexpart.write_namelist(c)
     38
     39        finalfile = os.path.join(c.inputdir, _config.FILE_NAMELIST)
     40        assert filecmp.cmp(testfile, finalfile, shallow=False)
     41
     42        # delete test file
     43        silent_remove(finalfile)
    2344
    2445    def test_retrieve(self):
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG