Changeset 2532 for TI05-delivery


Ignore:
Timestamp:
31/05/07 08:21:56 (12 years ago)
Author:
spascoe
Message:

Tidied up OWS Common XML dead end. I've decided it's best to convert
all OWS common data into objects in the ows_common package rather than
use ElementTree directly.

--This line, and those below, will be ignored--

M ows_server/tests/test_models.py
D ows_server/lib/wms_capabilities.py

Location:
TI05-delivery/ows_framework/trunk/ows_server/ows_server
Files:
1 deleted
1 edited

Legend:

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

    r2493 r2532  
    1 from unittest import TestCase 
    2 import pkg_resources 
    3  
    4 from elementtree import ElementTree as ET 
    5 from ows_server.lib.wms_capabilities import WmsOwsAdapter 
    6  
    7 class 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         print olr 
    28         assert olr == 'http://hostname/' 
    29  
    30     def testContactInformation(self): 
    31         ci = self.woa.contactInformation 
    32         print ci 
    33         assert ci == {'city': 'Greenbelt', 
    34                       'fax': '+1 301 555-1212', 
    35                       'organization': 'Acme Corporation', 
    36                       'state_or_province': 'MD', 
    37                       'country': 'USA', 
    38                       'telephone': '+1 301 555-1212', 
    39                       'person': 'Jeff Smith, Server Administrator', 
    40                       'postcode': '20771', 
    41                       'address': ['NASA Goddard Space Flight Center'], 
    42                       'position': 'Computer Scientist', 
    43                       'email': 'user@host.com' 
    44                       } 
    45  
    46     def testFees(self): 
    47         assert self.woa.fees == 'NONE' 
    48  
    49     def testAccessConstraints(self): 
    50         assert self.woa.accessConstraints == 'NONE' 
Note: See TracChangeset for help on using the changeset viewer.