From 973c69dffb957f868c25ee8ff5363856ca550549 Mon Sep 17 00:00:00 2001 From: pemontto Date: Mon, 8 Apr 2019 17:43:15 +1000 Subject: [PATCH] Updates tests --- .gitmodules | 4 ++-- bin/vuln_whisperer | 11 +++++++---- test | 1 - vulnwhisp/test/mock.py | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) delete mode 160000 test diff --git a/.gitmodules b/.gitmodules index 4d6eb1b..546e654 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "test"] - path = test +[submodule "tests/data"] + path = tests/data url = https://github.com/HASecuritySolutions/VulnWhisperer-tests diff --git a/bin/vuln_whisperer b/bin/vuln_whisperer index 010e9db..09ed142 100644 --- a/bin/vuln_whisperer +++ b/bin/vuln_whisperer @@ -37,10 +37,13 @@ def main(): help='The NESSUS username', type=lambda x: x.strip()) parser.add_argument('-p', '--password', dest='password', required=False, default=None, help='The NESSUS password', type=lambda x: x.strip()) - parser.add_argument('-F', '--fancy', action='store_true', help='Enable colourful logging output') - parser.add_argument('-d', '--debug', action='store_true', help='Enable debugging messages') - parser.add_argument('--mock', action='store_true', help='Enable mocked API responses') - parser.add_argument('--mock_dir', dest='mock_dir', required=False, default='test', + parser.add_argument('-F', '--fancy', action='store_true', + help='Enable colourful logging output') + parser.add_argument('-d', '--debug', action='store_true', + help='Enable debugging messages') + parser.add_argument('--mock', action='store_true', + help='Enable mocked API responses') + parser.add_argument('--mock_dir', dest='mock_dir', required=False, default=None, help='Path of test directory') args = parser.parse_args() diff --git a/test b/test deleted file mode 160000 index 606b8bc..0000000 --- a/test +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 606b8bcbe32b057376ea04b9b2e6a0b0e4454006 diff --git a/vulnwhisp/test/mock.py b/vulnwhisp/test/mock.py index fcc7e1c..5d48729 100644 --- a/vulnwhisp/test/mock.py +++ b/vulnwhisp/test/mock.py @@ -6,12 +6,12 @@ import httpretty class mockAPI(object): def __init__(self, mock_dir=None, debug=False): self.mock_dir = mock_dir + if not self.mock_dir: # Try to guess the mock_dir if python setup.py develop was used - self.mock_dir = '/'.join(__file__.split('/')[:-3]) + '/test' + self.mock_dir = '/'.join(__file__.split('/')[:-3]) + '/tests/data' self.logger = logging.getLogger('mockAPI') - if debug: self.logger.setLevel(logging.DEBUG)