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')
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')
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')
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')