Changeset 2596


Ignore:
Timestamp:
15/06/07 16:02:42 (12 years ago)
Author:
spascoe
Message:

Improved tests.

Location:
TI05-delivery/ows_framework/trunk/ows_server
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server.egg-info/PKG-INFO

    r2493 r2596  
    11Metadata-Version: 1.0 
    22Name: ows-server 
    3 Version: 0.0.0dev-r2488 
     3Version: 0.0.0dev-r2594 
    44Summary: UNKNOWN 
    55Home-page: UNKNOWN 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server.egg-info/SOURCES.txt

    r2493 r2596  
    11README.txt 
    22development.ini 
     3development_dom.ini 
     4eg_ows_capabilities.xml 
    35setup.cfg 
    46setup.py 
     
    2224ows_server/config/routing.py 
    2325ows_server/controllers/__init__.py 
    24 ows_server/controllers/dummy.py 
     26ows_server/controllers/csml_api.py 
     27ows_server/controllers/csml_wcs.py 
     28ows_server/controllers/csml_wms.py 
    2529ows_server/controllers/error.py 
    2630ows_server/controllers/template.py 
     
    3034ows_server/lib/app_globals.py 
    3135ows_server/lib/base.py 
     36ows_server/lib/csml_util.py 
     37ows_server/lib/decorators.py 
     38ows_server/lib/grid_util.py 
    3239ows_server/lib/helpers.py 
    33 ows_server/lib/wms_capabilities.py 
     40ows_server/lib/render.py 
     41ows_server/lib/validators.py 
    3442ows_server/models/__init__.py 
    3543ows_server/public/index.html 
    3644ows_server/templates/__init__.py 
    3745ows_server/templates/autohandler 
     46ows_server/templates/csml_describe.kid 
     47ows_server/templates/csml_describe_feature.kid 
    3848ows_server/templates/exception_report.kid 
    39 ows_server/templates/wms_service_metadata.kid 
     49ows_server/templates/ows/__init__.py 
     50ows_server/templates/ows/get_capabilities.kid 
     51ows_server/templates/ows/wcs_capabilities.kid 
     52ows_server/templates/ows/wms_capabilities.kid 
    4053ows_server/tests/__init__.py 
    4154ows_server/tests/exampleCapabilities1.xml 
     55ows_server/tests/make_data.py 
     56ows_server/tests/test_extract.py 
    4257ows_server/tests/test_models.py 
    4358ows_server/tests/functional/__init__.py 
    44 ows_server/tests/functional/test_dummy.py 
     59ows_server/tests/functional/test_csml_api.py 
     60ows_server/tests/functional/test_csml_wms.py 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/tests/functional/test_csml_wms.py

    r2594 r2596  
    77 
    88# This depends on the value randomly generated by csmlscan. 
    9 # However make_data.py sets the random seed so this shoukd work. 
     9# However make_data.py sets the random seed so this should work. 
    1010test_feature_id = 'DVVhDIq2' 
    1111 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/tests/make_data.py

    r2594 r2596  
    1414def make_var(grid): 
    1515    """ 
    16     Make a variable on a given grid with an X in it 
     16    Make a variable on a given grid with an X in it. 
     17    The first column and row are filled with their respective axis values. 
    1718 
    1819    """ 
    1920    i = N.indices(grid.shape) 
    20     a = N.where(i[0] == i[1], 10, 1) 
    21     a = N.where(i[0][-1::-1,:] == i[1], 10, a) 
     21    a = N.where(i[0] == i[1], 1000., 1.) 
     22    a = N.where(i[0][-1::-1,:] == i[1], 1000., a) 
     23 
     24    a[0] = grid.getLatitude().getValue() 
     25    a[:,0] = grid.getLongitude().getValue() 
     26 
    2227    a = N.array([a]) 
    2328 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/tests/test_extract.py

    r2594 r2596  
    4141    return var 
    4242 
    43 def print_var(var): 
    44     """ 
    45     Print var as bitmap. 
     43class TestExtractAll(TestCase): 
    4644 
    47     The test data contains 1's and 10's.  Convert these to 0 and 1. 
     45    def _checkBorder(self, var): 
     46        """ 
     47        The border of the variable should be filled with axis values. 
    4848 
    49     """ 
    50     print 'shape =', var.shape 
    51     print 'lat = ', var.getLatitude().getValue() 
    52     print 'lon = ', var.getLongitude().getValue() 
    53     a = N.where(var == 1, 0, var) 
    54     a = N.where(a == 10, 1, a) 
    55     for row in a: 
    56         print ''.join([str(x) for x in row]) 
     49        """ 
     50        lat5 = var.getLatitude().getValue()[5] 
     51        lon5 = var.getLongitude().getValue()[5] 
     52        self.assertEquals(var[0,5], lat5) 
     53        self.assertEquals(var[5,0], lon5) 
     54 
     55        lat30 = var.getLatitude().getValue()[30] 
     56        lon30 = var.getLongitude().getValue()[30] 
     57        self.assertEquals(var[0,30], lat30) 
     58        self.assertEquals(var[30,0], lon30) 
     59     
     60    def test1(self): 
     61        var = extract_csml(data_csml, 'cross_0_360p', 
     62                            time='1980-01-01T00:00:00.0') 
     63         
     64        self.assertEquals(var.shape, (36,36)) 
     65        self._checkBorder(var) 
     66 
     67    def test2(self): 
     68        var = extract_csml(data_csml, 'cross_0_360m', 
     69                            time='1980-01-01T00:00:00.0') 
     70        self.assertEquals(var.shape, (36,36)) 
     71        self._checkBorder(var) 
     72 
     73    def test3(self): 
     74        var = extract_csml(data_csml, 'cross_m180_180m', 
     75                            time='1980-01-01T00:00:00.0') 
     76        self.assertEquals(var.shape, (36,36)) 
     77        self._checkBorder(var) 
     78 
     79    def test4(self): 
     80        var = extract_csml(data_csml, 'cross_m180_180p', 
     81                            time='1980-01-01T00:00:00.0') 
     82        self.assertEquals(var.shape, (36,36)) 
     83        self._checkBorder(var) 
    5784 
    5885 
     
    6996                            latitude=(0, 90), 
    7097                            longitude=(0,180)) 
    71         print_var(var) 
    72         assert var.shape == (18,18) 
    73         assert N.trace(var[:,-1::-1]) == 180 
     98        self.assertEquals(var.shape, (18,18)) 
     99        #assert N.trace(var[:,-1::-1]) == 180 
    74100 
    75101    def testLatOrder2(self): 
     
    78104                            latitude=(0, 90), 
    79105                            longitude=(0,180)) 
    80         print_var(var) 
    81         assert var.shape == (18,18) 
    82         assert N.trace(var[:,-1::-1]) == 180 
     106        self.assertEquals(var.shape, (18,18)) 
     107        #assert N.trace(var[:,-1::-1]) == 180 
    83108 
    84109    def testLatOrder3(self): 
     
    87112                            latitude=(0, 90), 
    88113                            longitude=(-180,0)) 
    89         print_var(var) 
    90         assert var.shape == (18,18) 
    91         assert N.trace(var[:,-1::-1]) == 180 
     114        self.assertEquals(var.shape, (18,18)) 
     115        #assert N.trace(var[:,-1::-1]) == 180 
    92116 
    93117    def testLatOrder4(self): 
     
    96120                            latitude=(0, 90), 
    97121                            longitude=(-180,0)) 
    98         print_var(var) 
    99         assert var.shape == (18,18) 
    100         assert N.trace(var[:,-1::-1]) == 180 
     122        self.assertEquals(var.shape, (18,18)) 
     123        #assert N.trace(var[:,-1::-1]) == 180 
    101124 
Note: See TracChangeset for help on using the changeset viewer.