Logo Search packages:      
Sourcecode: qa-assistant version File versions  Download package

def checklist::CheckList::__Test::add_entry (   self,
  summary,
  item = None,
  display = None,
  desc = None,
  resolution = None,
  output = None,
  resList = None,
  outputList = None 
)

Adds new items to the checklist.

Arguments:
summary -- Summary of problem (also its key.)

Keyword arguments:
item -- entry is an item rather than a category. (default True)
display -- display the entry in output review. (default True)
desc -- long description about how to determine if the item has
passed or failed the test. (default None)
resolution -- state that the entry is in. (default Needs-Reviewing)
output -- output string for the entry. (default None)
resList -- list of valid resolutions. (default Needs-Reviewing, Pass,
   Fail, Non-Blocker, Not-Applicable)
outputList -- dict of output strings for each resList item. (default
      None for each resolution in resList)

Caveats:
* outputList[resolution] is set to output even if it already has a
  value.

Definition at line 351 of file checklist.py.

                                          :
        '''Adds new items to the checklist.
        
        Arguments:
        summary -- Summary of problem (also its key.)
        
        Keyword arguments:
        item -- entry is an item rather than a category. (default True)
        display -- display the entry in output review. (default True)
        desc -- long description about how to determine if the item has
                passed or failed the test. (default None)
        resolution -- state that the entry is in. (default Needs-Reviewing)
        output -- output string for the entry. (default None)
        resList -- list of valid resolutions. (default Needs-Reviewing, Pass,
                   Fail, Non-Blocker, Not-Applicable)
        outputList -- dict of output strings for each resList item. (default
                      None for each resolution in resList)

        Caveats:
        * outputList[resolution] is set to output even if it already has a
          value.
        '''

        # Make sure this entry isn't already listed.
        sumLow = summary.lower()
        if self.entries.has_key(sumLow):
            raise error.DuplicateItem, ('%s is already present in the'
                    ' checklist.' % (self.entries[sumLow]))

        # Set up all the default values.
        if item == None:
            item = True
        if display == None:
            display = True
        output = output or ''
        desc = desc or None
        resList = resList or ['Needs-Reviewing', 'Pass', 'Fail',
            'Non-Blocker', 'Not-Applicable']
        resolution = resolution or resList[0]
        if resolution not in resList:
            raise error.InvalidResolution, ('%s is not a resolution from the'
                    ' resolution List' % (resolution))

        # Make sure the outputList matches with the resList
        if not outputList:
            outputList = {}
            for res in resList:
                outputList[res] = ''
        else:
            outKeysList = outputList.keys()
            for res in resList:
                if res not in outKeysList:
                    outputList[res] = ''
        outputList[resolution] = output
       
        if self.customItemsIter:
            newItem = self.append(self.customItemsIter)
        else:
            self.customItemsIter = self.append(None)
            if sumLow == 'custom checklist items':
                newItem = self.customItemsIter
            else:
                # Create the 'Custom Checklist Items' category
                self.set(self.customItemsIter,
                        SUMMARY, 'Custom Checklist Items',
                        ISITEM, False,
                        RESLIST, ['Needs-Reviewing', 'Pass', 'Fail'],
                        RESOLUTION, 'Needs-Reviewing',
                        OUTPUT, '',
                        OUTPUTLIST, {'Needs-Reviewing': '',
                                     'Pass': '', 'Fail': ''},
                        DESC, "Review items that you have comments on even " \
                              "though they aren't on the standard checklist.",
                        TEST, None)
                newItem = self.append(self.customItemsIter)
                self.entries['custom checklist items'] = self.customItemsIter
        
        # Set up the new item
        self.set(newItem,
                SUMMARY, summary,
                DESC, desc,
                ISITEM, item,
                DISPLAY, display,
                RESOLUTION, resolution,
                OUTPUT, output,
                RESLIST, resList,
                OUTPUTLIST, outputList,
                TEST, None)
        self.entries[sumLow] = newItem

    def publish(self, filename=None):


Generated by  Doxygen 1.6.0   Back to index