source: flex_extract.git/source/pythontest/TestEcFlexpart.py @ 565fd93

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

added test class for EcFlexpart? unit tests

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