Skip to content

Commit

Permalink
Add unittest for get_summary_time_vt_as_xml_str()
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Dec 19, 2018
1 parent bab9879 commit bfc9f34
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/testWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,12 @@ def test_get_mtime_xml(self, mock_nvti, mock_db):
'1.3.6.1.4.1.25623.1.0.100061', mtime)

self.assertEqual(res, out)

def test_get_summary_xml(self, mock_nvti, mock_db):
w = DummyWrapper(mock_nvti, mock_db)
out = ('<summary>Detects the installed version of\n Mantis a free popular web-based bugtracking system.\n\n This script sends HTTP GET request and try to get the version from the\n response, and sets the result in KB.</summary>')
summary = w.VT['1.3.6.1.4.1.25623.1.0.100061'].get('summary')
res = w.get_summary_vt_as_xml_str(
'1.3.6.1.4.1.25623.1.0.100061', summary)

self.assertEqual(res, out)

0 comments on commit bfc9f34

Please sign in to comment.