Example #1
0
    def testEditVulnSyncGetsMapperDispatchedASYNC(self):
        vuln = ModelObjectVuln("coquito")

        params = ('new_name', 'new_desc', 'high', "ref1")

        self.genericEdit(vuln, params, controller.ModelController.editVulnASYNC, process_pending=True)

        self.assertEquals(vuln.getName(), 'new_name', "Name not updated")
        self.assertEquals(vuln.getDescription(), 'new_desc', "Description not updated")
        self.assertEquals(vuln.getSeverity(), 'high', "Severity not updated")
Example #2
0
    def testEditVulnSyncGetsMapperDispatchedSYNC(self):
        vuln = ModelObjectVuln("coquito")

        params = ('new_name', 'new_desc', 'high', "ref1")

        self.genericEdit(vuln, params, controller.ModelController.editVulnSYNC)

        self.assertEquals(vuln.getName(), 'new_name', "Name not updated")
        self.assertEquals(vuln.getDescription(), 'new_desc',
                          "Description not updated")
        self.assertEquals(vuln.getSeverity(), 'high', "Severity not updated")
Example #3
0
    def testChangeVulnDescriptionUsingUpdateAttributesMethod(self):
        """
        Until we have a single attribute to store the vuln's descrption
        we need to make sure we're always accessing the valid one (_desc)
        """
        vuln = ModelObjectVuln(
            name='VulnTest', desc='TestDescription', severity='info')

        self.assertEquals(vuln._desc, 'TestDescription',
            'Vulnerability desc should be the given during creation')

        vuln.updateAttributes(desc="new description")

        self.assertEquals(vuln.getDescription(), 'new description',
            'Vulnerability desc wasn\'t updated correctly')

        self.assertEquals(vuln._desc, 'new description',
            'Vulnerability desc wasn\'t updated correctly')
Example #4
0
    def testChangeVulnDescriptionUsingUpdateAttributesMethod(self):
        """
        Until we have a single attribute to store the vuln's descrption
        we need to make sure we're always accessing the valid one (_desc)
        """
        vuln = ModelObjectVuln(name='VulnTest',
                               desc='TestDescription',
                               severity='info')

        self.assertEquals(
            vuln._desc, 'TestDescription',
            'Vulnerability desc should be the given during creation')

        vuln.updateAttributes(desc="new description")

        self.assertEquals(vuln.getDescription(), 'new description',
                          'Vulnerability desc wasn\'t updated correctly')

        self.assertEquals(vuln._desc, 'new description',
                          'Vulnerability desc wasn\'t updated correctly')