Skip to content

Commit

Permalink
Merge pull request #1918 from UV-CDAT/fix_failing_tests_rename
Browse files Browse the repository at this point in the history
Added missing test file
  • Loading branch information
aashish24 committed Apr 8, 2016
2 parents ce6f078 + 8ddfda2 commit 7227709
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 3 deletions.
6 changes: 3 additions & 3 deletions testing/vcs/CMakeLists.txt
Expand Up @@ -213,10 +213,10 @@ cdat_add_test(test_vcs_vectors_missing
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_vectors_missing.py
"--source=${BASELINE_DIR}/test_vcs_vectors_missing.png"
)
cdat_add_test(test_remove_marker_none_1d
cdat_add_test(test_vcs_remove_marker_none_1d
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_remove_marker_none_1d.py
"${BASELINE_DIR}/test_remove_marker_none_1d.png"
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_remove_marker_none_1d.py
"${BASELINE_DIR}/test_vcs_remove_marker_none_1d.png"
)
cdat_add_test(test_vcs_png_window_resize
"${PYTHON_EXECUTABLE}"
Expand Down
56 changes: 56 additions & 0 deletions testing/vcs/test_vcs_verify_proj_basics.py
@@ -0,0 +1,56 @@

import vcs
import numpy
import cdtime

from vcs_test_common import *

x=vcs.init()
x.drawlogooff()

p=x.createprojection()
assert(p.type == "linear")
assert(vcs.queries.isprojection(p))

test_values_setting(p, "type", [-1,-2,-3,'linear', 'albers equal area', 'lambert', 'mercator', 'polar', 'polyconic', 'equid conic a', 'transverse mercator', 'stereographic', 'lambert azimuthal', 'azimuthal', 'gnomonic', 'orthographic', 'gen. vert. near per', 'sinusoidal', 'equirectangular', 'miller', 'van der grinten', 'hotin', 'robinson', 'space oblique', 'alaska', 'interrupted goode', 'mollweide', 'interrupted mollweide', 'hammer', 'wagner iv', 'wagner vii', 'oblated', 0, 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,p,"POLAR","leac"," POlyConic ",],["utm","state plane","foo",-4,31,256,[],{},])
b = x.createprojection("test_b_ok",p.name)
assert(b.name == "test_b_ok")
assert(b.type == "polyconic")
## From vcs validation
for t in range(31):
good = []
bad =[]
pos = []
for param,val in vcs.VCS_validation_functions.proj_ok_parameters.iteritems():
if t in val[0]:
good.append(param)
pos.append(val[1])
else:
bad.append(param)
b.type=t
b._parameters = [1e+20, 1e+20, 1e+20, 1e+20, 1e+20, 1e+20, 1e+20, 1e+20, 1e+20, 1e+20, 1e+20, 1e+20, 1e+20, 1e+20, 1e+20]
for i,att in enumerate(good):
if (att in ['azimuthalangle','azimuthallongitude','satellite','path',] and (b.parameters[12]==0. or b.parameters[12]==1.e20)) \
or \
( att=='standardparallel' and b.parameters[8]==1) \
or \
( att in ['standardparallel1','standardparallel2'] and (b.parameters[8]==0 or b.parameters[8]==1.e20) and t==8)\
:
continue
test_values_setting(b,att,[0.,])
if b.type == "equid conic" and att=="subtype":
ipos = 8
else:
ipos = pos[i]
assert(b.parameters[ipos]==0.)
for att in bad:
try:
setattr(b,att,[],[0.,])
success = True
except:
success = False
else:
if success:
raise ValueError, "Shouldn't have been able to set '%s' on projection of type %s" % (att,b.type)


0 comments on commit 7227709

Please sign in to comment.