File: Change.py.test.in

package info (click to toggle)
cdo 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 49,836 kB
  • sloc: cpp: 185,271; ansic: 95,766; sh: 7,192; f90: 6,147; makefile: 1,977; ruby: 1,078; csh: 1,028; python: 995; fortran: 319; pascal: 219; perl: 9
file content (27 lines) | stat: -rw-r--r-- 706 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! @PYTHON@

from cdoTest import *

HAS_THREADS= cdo_check_req("has-threads")

FORMAT="-f srv -b 32"
SHOW=["showcode","showname","showunit","showlevel"]
OPERATORS=["chcode","chname","chunit","chlevel"]
PARAM_IN=["-1","topo","m","0"]
PARAM_OUT=["101","newname","km","101"]
IFILE="-topo"
CDO_CALL=f'{CDO} -s {FORMAT}'
RFILE="change_ref"
OFILE="change_res"

test_module = TestModule()

for SHOW,OPERATOR,PIN,POUT in zip(SHOW,OPERATORS,PARAM_IN,PARAM_OUT):
    t = TAPTest(f'{OPERATOR}')
    t.add(f'echo {POUT} >> {RFILE}')
    t.add(f'{CDO} {FORMAT} {SHOW} -{OPERATOR},{PIN},{POUT} {IFILE} >> {OFILE}')
    t.add(f'diff -w {OFILE} {RFILE}')
    t.clean(OFILE,RFILE)
    test_module.add(t)

test_module.run()