Changeset 5619 for cows_wps


Ignore:
Timestamp:
14/08/09 15:49:09 (10 years ago)
Author:
spascoe
Message:

Renamed Job controller User controller

Location:
cows_wps/trunk/cows_wps
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/cows_wps/controllers/user.py

    r5615 r5619  
    1111log = logging.getLogger(__name__) 
    1212 
    13 class JobController(BaseController): 
     13class UserController(BaseController): 
    1414    """ 
    1515    provides details of user jobs. 
     
    4343            self.reduceNumberOfOutputsSentPerZipPerJob(previousJobs) 
    4444                 
    45         previousJobs.sort(cmp=JobController.sortContextBySubmissionDate, reverse=True) 
    46         currentJobs.sort(cmp=JobController.sortContextBySubmissionDate, reverse=True) 
     45        previousJobs.sort(cmp=UserController.sortContextBySubmissionDate, reverse=True) 
     46        currentJobs.sort(cmp=UserController.sortContextBySubmissionDate, reverse=True) 
    4747         
    4848#        log.debug("current jobs = %s" % (len(currentJob),)) 
  • cows_wps/trunk/cows_wps/routing.py

    r5615 r5619  
    1616    map.connect('status/:requestId', controller='status') 
    1717    map.connect('dl/:jobId/:fileName', controller='download') 
    18     map.connect('job/:userId', controller='job', fullDetails=False) 
    19     map.connect('job/:userId/full', controller='job', fullDetails=True) 
    20     map.connect('job/:userId/streamlined', controller='job', streamlined=True) 
     18    map.connect('user/:userId', controller='user', fullDetails=False) 
     19    map.connect('user/:userId/full', controller='user', fullDetails=True) 
     20    map.connect('user/:userId/streamlined', controller='user', streamlined=True) 
    2121    map.connect(':controller/:action/:job_id') 
    2222    map.connect(':controller/:action/:userId/:jobId') 
  • cows_wps/trunk/cows_wps/tests/test_job_index_action.py

    r5615 r5619  
    55 
    66import cows_wps.tests.setup_test_wps_config  
    7 import cows_wps.controllers.job as job 
     7import cows_wps.controllers.user as user 
    88from cows_wps.tests.context_for_testing import ContextForTesting 
    99from cows_wps.process_handler.context.process_status import STATUS 
     
    1616class TestJobIndexAction(unittest.TestCase): 
    1717    def setUp(self): 
    18         self.oldRequestManager = job.requestManager 
    19         self.oldResponse = job.response 
     18        self.oldRequestManager = user.requestManager 
     19        self.oldResponse = user.response 
    2020        self.replaceRequestManager() 
    2121        self.replaceResponse() 
    2222         
    23         self.oldRequestObject = job.request 
     23        self.oldRequestObject = user.request 
    2424        self.replaceRequestObject() 
    2525        self.userId = 'someUser' 
    2626         
    27         self.jc = job.JobController() 
     27        self.jc = user.UserController() 
    2828     
    2929    def tearDown(self): 
    30         job.requestManager = self.oldRequestManager 
    31         job.response = self.oldResponse 
    32         job.request = self.oldRequestObject 
     30        user.requestManager = self.oldRequestManager 
     31        user.response = self.oldResponse 
     32        user.request = self.oldRequestObject 
    3333     
    3434    def replaceRequestManager(self): 
     
    5959        newRequestManager.iterContextsByUser = iterContextsByUser 
    6060        newRequestManager.updateRunningRequests = updateRunningRequests 
    61         job.requestManager = newRequestManager 
     61        user.requestManager = newRequestManager 
    6262 
    6363    def replaceResponse(self): 
    64         job.response = EmptyClass() 
     64        user.response = EmptyClass() 
    6565     
    6666    def replaceRequestObject(self): 
    67         job.request = EmptyClass() 
     67        user.request = EmptyClass() 
    6868        self.jobParams = {} 
    69         job.request.params = self.jobParams 
     69        user.request.params = self.jobParams 
    7070          
    7171    def test_001_CancelledJobsNotIncludedInResponse(self): 
  • cows_wps/trunk/cows_wps/tests/workflow/sync1.txt

    r5615 r5619  
    1616Initially the user has no jobs running or pending. 
    1717 
    18     >>> r = app.get('/job/%s' % userId) 
     18    >>> r = app.get('/user/%s' % userId) 
    1919    >>> print >>open('./sync1_doctest.out1', 'w'), r.body 
    2020    >>> '<PreviousJobsCount>0</P' in r.body 
     
    3636Now check the job is visible as completed on the jobs controller 
    3737 
    38      r = app.get('/job/%s' % userId) 
     38     r = app.get('/user/%s' % userId) 
    3939     '<PreviousJobsCount>1</P' in r.body 
    4040    True 
Note: See TracChangeset for help on using the changeset viewer.