source: MILK/trunk/milk_server/milk_server/tests/functional/test_fetch.py @ 4472

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/MILK/trunk/milk_server/milk_server/tests/functional/test_fetch.py@4472
Revision 4472, 1.4 KB checked in by cbyrom, 12 years ago (diff)

Strip out code not relevant to MILK - mainly WCS and WMS stuff - also including the CSML server code + trackback code
Also tidy up structure of 'public' dir - setting up new 'style' dir and
centralising icons in icons dir + remove all unused icons, javascript and stylesheets.
Also strip out testcase code and populate new test directory structure.

Line 
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
15from milk_server.tests import *
16import logging
17
18logging.basicConfig(level=logging.DEBUG,
19                        format='%(asctime)s %(filename)s:%(lineno)d %(levelname)s %(message)s')
20
21class TestFetchController(TestController):
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 TracBrowser for help on using the repository browser.