Changeset 3663


Ignore:
Timestamp:
Sep 25, 2006, 4:52:44 PM (18 years ago)
Author:
duncan
Message:

added tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/geospatial_data/test_geospatial_data.py

    r3514 r3663  
    246246                                              [1.0, 2.1], [3.0, 5.3]])
    247247       
     248    def test_addII(self):
     249        """ test the addition of two geospatical objects
     250            no geo_reference see next test
     251        """
     252        points = [[1.0, 2.1], [3.0, 5.3]]
     253        attributes = {'depth':[2, 4]}
     254        G1 = Geospatial_data(points, attributes)
     255       
     256        points = [[5.0, 2.1], [3.0, 50.3]]
     257        attributes = {'depth':[200, 400]}
     258        G2 = Geospatial_data(points, attributes)
     259       
     260#        g3 = geospatial_data2points_dictionary(G1)
     261#        print 'g3=', g3
     262       
     263        G = G1 + G2
     264
     265        assert G.attributes.has_key('depth')
     266        assert G.attributes.keys(), ['depth']
     267        assert allclose(G.attributes['depth'], [2, 4, 200, 400])
     268        assert allclose(G.get_data_points(), [[1.0, 2.1], [3.0, 5.3],
     269                                              [5.0, 2.1], [3.0, 50.3]])
    248270    def test_add_with_geo (self):
    249271        """
Note: See TracChangeset for help on using the changeset viewer.