Exemplo n.º 1
0
    def testStandarizeUpdatedSeverity(self):
        vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
                                severity='informational')

        self.assertEquals(vuln.severity, 'info',
                'Vulnerability severity not transformed correctly')

        vuln.updateAttributes(severity='3')
        self.assertEquals(vuln.severity, 'high',
                'Vulnerability severity not transformed correctly')
Exemplo n.º 2
0
    def testStandarizeUpdatedSeverity(self):
        vuln = ModelObjectVuln(name='VulnTest',
                               desc='TestDescription',
                               severity='informational')

        self.assertEquals(vuln.severity, 'info',
                          'Vulnerability severity not transformed correctly')

        vuln.updateAttributes(severity='3')
        self.assertEquals(vuln.severity, 'high',
                          'Vulnerability severity not transformed correctly')
Exemplo n.º 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')
Exemplo n.º 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')