Skip to content

Commit

Permalink
Add test for multiple occurences of single vector in text
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktória Tóthová committed Aug 1, 2018
1 parent 96720bb commit 9ae582f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_cvss2.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ def test_parse_from_text_cvss2(self):
e = [CVSS2(v)]
self.assertEqual(parser.parse_cvss_from_text(i), e)

def test_parse_from_text_multiple_vectors_same_cvss(self):
v = 'AV:N/AC:L/Au:N/C:C/I:C/A:C'
e = [CVSS2(v)]
i = 'Title: {}\nThis is an overview of {} problem.\nLinks: {}'.format(v,v,v)
self.assertEqual(parser.parse_cvss_from_text(i), e)


if __name__ == '__main__':
unittest.main()
5 changes: 5 additions & 0 deletions tests/test_cvss3.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ def test_parse_from_text_both_versions(self):
i = 'xxx.' + v1 + ' ' + v2 + '.xxx'
e = [CVSS3(v1), CVSS2(v2)]
self.assertEqual(parser.parse_cvss_from_text(i), e)
def test_parse_from_text_multiple_vectors_same_cvss(self):
v = 'CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H'
e = [CVSS3(v)]
i = 'Title: {}\nThis is an overview of {} problem.\nLinks: {}'.format(v,v,v)
self.assertEqual(parse_cvss_from_text(i), e)


if __name__ == '__main__':
Expand Down

0 comments on commit 9ae582f

Please sign in to comment.