ctbtodev
Rev | Line | |
---|
[565fd93] | 1 | #!/usr/bin/env python |
---|
| 2 | # -*- coding: utf-8 -*- |
---|
| 3 | |
---|
| 4 | |
---|
| 5 | import sys |
---|
| 6 | import os |
---|
| 7 | import inspect |
---|
| 8 | import pytest |
---|
| 9 | |
---|
| 10 | sys.path.append('../python') |
---|
| 11 | import _config |
---|
| 12 | from classes.EcFlexpart import EcFlexpart |
---|
| 13 | from classes.ControlFile import ControlFile |
---|
| 14 | from mods.tools import silent_remove |
---|
| 15 | |
---|
| 16 | class 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.