source: flex_extract.git/source/pythontest/TestEcFlexpart.py @ c5074d2

ctbtodev
Last change on this file since c5074d2 was c5074d2, checked in by Anne Philipp <anne.philipp@…>, 6 years ago

added making of namelist file and jobscript via genshi templates

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[067a0c3]1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
[25b14be]4
[067a0c3]5import sys
[c5074d2]6import os
7import inspect
[25b14be]8import pytest
[067a0c3]9
10sys.path.append('../python')
[c5074d2]11import _config
[25b14be]12from classes.EcFlexpart import EcFlexpart
[c5074d2]13from classes.ControlFile import ControlFile
14from mods.tools import silent_remove
[067a0c3]15
[25b14be]16class TestEcFlexpart():
[067a0c3]17    '''
18    '''
19
[25b14be]20    def test_write_namelist(self):
[c5074d2]21        import filecmp
22
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)
[067a0c3]44
[25b14be]45    def test_retrieve(self):
[067a0c3]46        # not sure how to check
[25b14be]47        assert True == True
[067a0c3]48
49
50# these functions should test the output and compare the results with an output
51# of the old version and check if there are no differences!!!
52# also check for errors?! Or check if it works for alle datasets and private public etc
53
54    #    - process_output
55    #    - create
56    #    - deacc_fluxes
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG