view tests/testGroupIdRename.py @ 44:b7e64d0a3a7c

CVE: Add a generator to our generated document
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 30 Dec 2014 12:17:45 +0100
parents 1ea1a3c3c790
children
line wrap: on
line source
from datetime import datetime

from tests.utils import TestCase
from farolluz.cvrf import CVRFFullProductName, CVRFGroup, CVRFVulnerability, CVRFThreat

class TestGroupIdRename(TestCase):

    def testChangeGroupId(self):
        ptree = self.doc.createProductTree()
        prod1 = CVRFFullProductName('1', 'a', ptree)
        ptree.addProduct(prod1)
        prod2 = CVRFFullProductName('2', 'b', ptree)
        ptree.addProduct(prod2)
        grp = CVRFGroup('GRP-1')
        grp.addProductID('1')
        grp.addProductID('2')
        ptree.addGroup(grp)
        vuln = CVRFVulnerability(1)
        th = CVRFThreat('Impact', 'bad !')
        th.addGroupID('GRP-1')
        vuln.addThreat(th)
        self.doc.addVulnerability(vuln)
        self._validate()
        grp._productid = 'GRP-2'
        self.doc.changeProductID('GRP-1', 'GRP-2')
        self._validate()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)