Limit tab completion of scan command to scans with installed components (#74)

* scans without installed requirements dont tab-complete

* added meets_requirements functions to classes

* updated tests

* added check for None case
This commit is contained in:
epi052
2020-06-28 15:33:34 -05:00
committed by GitHub
parent 6ed51a19be
commit 4d1aef2d34
14 changed files with 179 additions and 45 deletions

View File

@@ -428,12 +428,17 @@ class TestReconShell:
"webbrowser.open", autospec=True
) as mocked_web, patch("selectors.DefaultSelector.register", autospec=True) as mocked_selector, patch(
"cmd2.Cmd.select"
) as mocked_select:
) as mocked_select, patch(
"pipeline.recon-pipeline.get_scans"
) as mocked_scans:
mocked_select.return_value = "Resume"
mocked_popen.return_value = process_mock
test_input += f" --results-dir {tmp_path / 'mostuff'}"
mocked_scans.return_value = {"FullScan": ["pipeline.recon.wrappers"]}
if db_mgr is None:
self.shell.do_scan(test_input)
assert expected in capsys.readouterr().out