source: ceda_http_fileserver/trunk/ceda_http_fileserver/ceda/server/wsgi/fileserver/test/test_fileserver.py @ 6999

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/ceda_http_fileserver/trunk/ceda_http_fileserver/ceda/server/wsgi/fileserver/test/test_fileserver.py@6999
Revision 6999, 1.6 KB checked in by pjkersha, 10 years ago (diff)

Incomplete - task 9: Data Browser Replacement

  • fixes to do_get
  • Property svn:keywords set to Id
Line 
1"""CEDA (Centre for Environmental Data Archival) HTTP file server application
2unit test module
3
4CEDA HTTP File Server WSGI Application
5"""
6__author__ = "P J Kershaw"
7__date__ = "11/06/10"
8__copyright__ = "(C) 2010 Science and Technology Facilities Council"
9__license__ = """http://www.apache.org/licenses/LICENSE-2.0"""
10__contact__ = "Philip.Kershaw@stfc.ac.uk"
11__revision__ = '$Id$'
12import logging
13logging.basicConfig(level=logging.DEBUG)
14
15import unittest
16from os import path
17
18import paste.fixture
19from paste.deploy import loadapp
20
21from ceda.server.wsgi.fileserver.app import FileServerApp
22
23
24class FileServerAppTestCase(unittest.TestCase):
25    def __init__(self, *args, **kwargs):
26        app = FileServerApp()
27        self.app = paste.fixture.TestApp(app)
28         
29        unittest.TestCase.__init__(self, *args, **kwargs)
30
31    def test01Assert(self):
32        # Check the middleware has set the MyProxy client object in environ
33        response = self.app.get('/', status=200)
34        self.assert_(response)
35
36    def test01(self):
37        pass
38   
39   
40class FileServerAppTestCaseBase(unittest.TestCase): 
41    """Base class for common Paste Deploy related set-up"""
42    THIS_DIR = path.abspath(path.dirname(__file__))
43    INI_FILENAME = 'fileserver.ini'
44    INI_FILEPATH = path.join(THIS_DIR, INI_FILENAME)
45   
46    def __init__(self, *args, **kwargs):
47        wsgiapp = loadapp('config:' + self.__class__.INI_FILEPATH)
48        self.app = paste.fixture.TestApp(wsgiapp)
49               
50        unittest.TestCase.__init__(self, *args, **kwargs) 
51   
52if __name__ == "__main__":
53    unittest.main()
54
Note: See TracBrowser for help on using the repository browser.