Ignore:
Timestamp:
08/09/08 10:07:08 (13 years ago)
Author:
cbyrom
Message:

Extend controller level test suite.

File:
1 edited

Legend:

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

    r2740 r4182  
     1""" 
     2Test cases for the ows fetch controller 
     3 
     4NERC Data Grid Project 
     5""" 
     6__author__ = "C Byrom - Tessella" 
     7__date__ = "03/09/08" 
     8__copyright__ = "(C) 2008 STFC & NERC" 
     9__license__ = \ 
     10"""This software may be distributed under the terms of the Q Public  
     11License, version 1.0 or later.""" 
     12__contact__ = "b.n.lawrence@rl.ac.uk" 
     13__revision__ = '$Id: $' 
     14 
    115from ows_server.tests import * 
     16import logging 
     17 
     18logging.basicConfig(level=logging.DEBUG, 
     19                        format='%(asctime)s %(filename)s:%(lineno)d %(levelname)s %(message)s') 
    220 
    321class TestFetchController(TestController): 
    4     def test_index(self): 
    5         response = self.app.get(url_for(controller='fetch')) 
    6         # Test response... 
     22    def testFetchFileSecurityOn(self): 
     23        response = self.app.get(url_for(controller='fetch', \ 
     24                                        file='testSecurityOn', action='fetchFile')) 
     25        self.assertEqual(response.status, 200) 
     26 
     27    def testFetchFileSecurityOff(self): 
     28        response = self.app.get(url_for(controller='fetch', \ 
     29                                        file='testSecurityOff', action='fetchFile')) 
     30        self.assertEqual(response.status, 200) 
     31         
     32    def testInvalidFetchFile(self): 
     33        try: 
     34            response = self.app.get(url_for(controller='fetch', \ 
     35                                            file='blah', action='fetchFile')) 
     36            self.fail("An exception should have been thrown") 
     37        except IOError, e: 
     38            pass 
     39        except Exception, e: 
     40            self.fail("An IOError should have been thrown") 
     41             
     42         
Note: See TracChangeset for help on using the changeset viewer.