Changeset 2067

Show
Ignore:
Timestamp:
02/28/07 16:53:19 (2 years ago)
Author:
edunne
Message:

TestCaseManagementPlugin:

added an additional check on the testcases request parameter to see if the parameter is a list, unicode string, or ascii character string. If it is a string I convert it to a list.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • testcasemanagementplugin/branches/testManagementPlugin0.2.1/testManagementPlugin/testRuns.py

    r2026 r2067  
    9494        if users == None : 
    9595            return False, "No users selected for test run" 
     96        #check to see if the user parameter is a str or a list (well if it isn't a unicode or str then it is a list) 
    9697        if isinstance( users, unicode):  
    9798            users = [users.encode('ascii', 'ignore')] 
    98          
     99        if isinstance( users, str):  
     100            users = [users] 
    99101         
    100102        version = version.encode('ascii', 'ignore').strip() 
     
    153155 
    154156    def createCombinedTestCaseList( self, testTemplates, testcases, req ) : 
    155         #ok we are expecting lists to be returned for testcase,templates,and users...but if only one user is returned that's no good so check to see if we are dealing with a list or unicode string 
    156         if isinstance( testcases, unicode) : 
    157             testcases = [testcases.encode('ascii', 'ignore')] 
     157        #ok we are expecting a testcases to be a list but check to see if it is a str or unicode str.  If it is convert it to a list.if isinstance( testcases, unicode) : 
     158        testcases = [testcases.encode('ascii', 'ignore')] 
     159         
     160        if isinstance( testcases, str ): 
     161            testcases = [testcases] 
     162         
    158163        if isinstance( testTemplates, unicode) : 
    159164            testTemplates = [testTemplates.encode('ascii', 'ignore')]