Skip to content

Commit

Permalink
Add test for format_vt_modification_time() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Mar 21, 2019
1 parent eb3a550 commit 7c18e86
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 @@ -23,6 +23,7 @@
from unittest.mock import patch
from ospd_openvas.wrapper import OSPD_PARAMS
from tests.dummywrapper import DummyWrapper
from ospd_openvas.wrapper import OpenVasVtsFilter

OSPD_PARAMS_OUT = {
'auto_enable_dependencies': {
Expand Down Expand Up @@ -454,3 +455,11 @@ def test_scan_is_stopped(self, mock_nvti, mock_db):
w = DummyWrapper(mock_nvti, mock_db)
ret = w.scan_is_stopped('123-456')
self.assertEqual(ret, True)

class TestFilters(unittest.TestCase):

def test_format_vt_modification_time(self):
ovformat = OpenVasVtsFilter()
td = '$Date: 2018-02-01 02:09:01 +0200 (Thu, 18 Oct 2018) $'
formated = ovformat.format_vt_modification_time(td)
self.assertEqual(formated, "20180201020901")

0 comments on commit 7c18e86

Please sign in to comment.