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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/MILK/trunk/milk_server/milk_server/tests/functional/test_retrieve.py@4472
Revision 4472, 2.3 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 retrieve 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 TestRetrieveController(TestController):
22    def testInvalidURIIndex(self):
23        try:
24            response = self.app.get(url_for(controller='retrieve', uri='blah'))
25            self.fail('An exception should have been thrown here')
26        except Exception, e:
27            print e
28            print type(e)
29            assert 'not a valid' in e.message
30
31
32    def testValidDEURIIndex(self):
33        try:
34            response = self.app.get(url_for(controller='retrieve',uri='badc.nerc.ac.uk__DIF__dataent_ERBE'))
35            self.assertEqual(response.status, 200)
36        except Exception, e:
37            print e
38            print type(e)
39            self.fail('An exception should not have been thrown here')
40
41
42    def testValidNDGB1URIIndex(self):
43        try:
44            response = self.app.get(url_for(controller='retrieve',uri='badc.nerc.ac.uk__NDG-B1__dataent_ERBE'))
45            self.assertEqual(response.status, 200)
46        except Exception, e:
47            print e
48            print type(e)
49            self.fail('An exception should not have been thrown here')
50
51
52    def testValidAtomURIIndex(self):
53        try:
54            response = self.app.get(url_for(controller='retrieve',uri='badc.nerc.ac.uk__ATOM__dataent_11679938403412067'))
55            self.assertEqual(response.status, 200)
56        except Exception, e:
57            print e
58            print type(e)
59            self.fail('An exception should not have been thrown here')
60
61    def testValidDEURIView(self):
62        try:
63            response = self.app.get(url_for(controller='retrieve', action='view', uri='badc.nerc.ac.uk__DIF__dataent_ERBE'))
64            self.assertEqual(response.status, 200)
65        except Exception, e:
66            print e
67            print type(e)
68            self.fail('An exception should not have been thrown here')
Note: See TracBrowser for help on using the repository browser.