Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Oct 20, 2021
1 parent 77346f5 commit c9f3ebf
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tests/test_nvti_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def test_get_nvt_metadata(self, MockOpenvasDB):
'',
'URL:http://www.mantisbt.org/',
'3',
'10',
'Product detection',
'Mantis Detection',
]
Expand Down Expand Up @@ -204,7 +203,7 @@ def test_get_nvt_metadata(self, MockOpenvasDB):
'id': '0',
'type': 'entry',
'name': 'timeout',
'description': 'Script Timeout',
'description': 'Description',
'default': '10',
},
'1': {
Expand All @@ -217,7 +216,10 @@ def test_get_nvt_metadata(self, MockOpenvasDB):
},
}

prefs1 = ['1|||dns-fuzz.timelimit|||entry|||default']
prefs1 = [
'0|||timeout|||entry|||10',
'1|||dns-fuzz.timelimit|||entry|||default',
]

MockOpenvasDB.get_list_item.side_effect = [metadata, prefs1]
resp = self.nvti.get_nvt_metadata('1.2.3.4')
Expand Down Expand Up @@ -261,13 +263,6 @@ def test_get_nvt_prefs(self, MockOpenvasDB):

self.assertEqual(resp, prefs)

def test_get_nvt_timeout(self, MockOpenvasDB):
MockOpenvasDB.get_single_item.return_value = '300'

resp = self.nvti.get_nvt_timeout('1.2.3.4')

self.assertEqual(resp, '300')

def test_get_nvt_tags(self, MockOpenvasDB):
tag = (
'last_modification=1533906565'
Expand Down

0 comments on commit c9f3ebf

Please sign in to comment.