annotate tests/testGroupIdRename.py @ 39:2e36289616db

Don't consider a Base Score of 0 as no Base Score
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 23 Dec 2014 09:01:38 +0100
parents 1ea1a3c3c790
children
rev   line source
31
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
1 from datetime import datetime
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
2
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
3 from tests.utils import TestCase
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
4 from farolluz.cvrf import CVRFFullProductName, CVRFGroup, CVRFVulnerability, CVRFThreat
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
5
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
6 class TestGroupIdRename(TestCase):
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
7
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
8 def testChangeGroupId(self):
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
9 ptree = self.doc.createProductTree()
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
10 prod1 = CVRFFullProductName('1', 'a', ptree)
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
11 ptree.addProduct(prod1)
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
12 prod2 = CVRFFullProductName('2', 'b', ptree)
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
13 ptree.addProduct(prod2)
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
14 grp = CVRFGroup('GRP-1')
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
15 grp.addProductID('1')
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
16 grp.addProductID('2')
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
17 ptree.addGroup(grp)
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
18 vuln = CVRFVulnerability(1)
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
19 th = CVRFThreat('Impact', 'bad !')
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
20 th.addGroupID('GRP-1')
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
21 vuln.addThreat(th)
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
22 self.doc.addVulnerability(vuln)
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
23 self._validate()
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
24 grp._productid = 'GRP-2'
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
25 self.doc.changeProductID('GRP-1', 'GRP-2')
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
26 self._validate()
1ea1a3c3c790 Add method to change a Group ID
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
27
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)