File: Magplot.py.test.in

package info (click to toggle)
cdo 2.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,964 kB
  • sloc: cpp: 180,221; ansic: 95,352; sh: 7,292; f90: 6,089; makefile: 1,975; ruby: 1,078; csh: 1,020; python: 995; fortran: 319; pascal: 219; perl: 9
file content (35 lines) | stat: -rw-r--r-- 842 bytes parent folder | download | duplicates (2)
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
28
29
30
31
32
33
34
35
#! @PYTHON@

from cdoTest import *
import os

HAS_MAGICS=cdo_check_req("has-magics")

CDOTESTDATA=os.getenv("CDOTESTDATA") or ""
XTESTDIR=f'{CDOTESTDATA}/magics/'

DEVICE="png"
OPERATORS=["shaded","grfill"]

test_module=TestModule()

for OPER in OPERATORS:
    if (not HAS_MAGICS):
        test_module.add_skip("Magics not enabled")
        continue
    if (not os.path.isdir(XTESTDIR)):
        test_module.add_skip("test not enabled")
        continue

    IFILE=f'{XTESTDIR}/tsurf_data.grb'
    OBASE=f'res_mag_{OPER}'
    OFILE=f'{OBASE}_tsurf.png'
    RFILE=f'{XTESTDIR}/ref_mag_{OPER}_tsurf.png'

    t=TAPTest(f'{OPER},device={DEVICE}')
    t.add(f'{CDO} {OPER},"device={DEVICE},list=200;240;250;260;270;280;290;300;340" {IFILE} {OBASE}')
#    t.add(f'cmp {RFILE} {OFILE}')
    t.clean(OFILE)
    test_module.add(t)

test_module.run()