Ignore:
Timestamp:
17/05/07 11:49:21 (13 years ago)
Author:
spascoe
Message:

Moved wms_capabilities test cases to the correct place. Implemented
several tests using an OGC example document.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/tests/test_models.py

    r2476 r2488  
     1from unittest import TestCase 
     2import pkg_resources 
     3 
     4from elementtree import ElementTree as ET 
     5from ows_server.lib.wms_capabilities import WmsOwsAdapter 
     6 
     7class TestWmsCapabilities(TestCase): 
     8    def setUp(self): 
     9        fh = pkg_resources.resource_stream('ows_server.tests', 
     10                                           'exampleCapabilities1.xml') 
     11        self.woa = WmsOwsAdapter(ET.parse(fh)) 
     12 
     13    def testTitle(self): 
     14        assert 'Acme Corp. Map Server' in self.woa.title 
     15 
     16    def testAbstract(self): 
     17        abstracts = self.woa.abstracts 
     18        assert len(abstracts) == 1 
     19        assert 'Contact: webmaster@wmt.acme.com' in abstracts[0] 
     20 
     21    def testKeywords(self): 
     22        keywords = self.woa.keywords 
     23        assert keywords == ['bird', 'roadrunner', 'ambush'] 
     24 
     25    def testOnlineResource(self): 
     26        olr = self.woa.onlineResource 
     27        assert olr == 'http://hostname/' 
Note: See TracChangeset for help on using the changeset viewer.