Ignore:
Timestamp:
15/06/10 14:34:23 (10 years ago)
Author:
pjkersha
Message:

Incomplete - task 9: Data Browser Replacement

  • Major fix for handling environSCRIPT_NAME?
  • removed reconstruct_url function - not needed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ceda_http_fileserver/trunk/ceda_http_fileserver/ceda/server/wsgi/fileserver/test/test_fileserver.py

    r7028 r7031  
    179179        # Test with alternative mount point to the default '/' 
    180180        self.fileServerApp.mountPoint = '/file-server' 
    181         requestPath = '/file-server'+ self.__class__.HTDOCS_SUBDIR3_URIPATH 
     181        requestPath = '/file-server' + self.__class__.HTDOCS_SUBDIR3_URIPATH 
    182182         
    183183        response = self.app.get(requestPath, status=httplib.OK) 
    184184        print(response.body) 
    185185        self.assert_(self.__class__.PDF_FILENAME in response.body) 
     186         
     187    def test13WithEnvironScriptName(self): 
     188        # Test with the application mounted at environ['SCRIPT_NAME'] 
     189        extra_environ = {'SCRIPT_NAME': '/myfileserver'} 
     190        requestPath = '/myfileserver' + self.__class__.HTDOCS_SUBDIR3_URIPATH 
     191         
     192        app = paste.fixture.TestApp(self.fileServerApp, 
     193                                    extra_environ=extra_environ) 
     194         
     195        response = app.get(requestPath, 
     196           extra_environ = {'PATH_INFO': self.__class__.HTDOCS_SUBDIR3_URIPATH}, 
     197           status=httplib.OK) 
     198        print(response.body) 
     199        self.assert_(self.__class__.PDF_FILENAME in response.body) 
     200         
    186201                
    187202         
Note: See TracChangeset for help on using the changeset viewer.