Dependency Checking (#75)

* Adds req testing methodology, needs fixes

* Improves dependency exception handling

* Better meets_requirements implementation

Still need to adjust tests to fake installation

* Changes to exception boolean to enable tool check

tests and class variables modified for new tool check

* Adjust test_get_scans to use appropriate variable

* Adds Go requirement where relevant

* Adds missing scan dependencies

* Add clarification to error message
This commit is contained in:
Ryan Good
2020-08-07 08:48:49 -05:00
committed by GitHub
parent d97315a2da
commit d7dbd1e7b3
21 changed files with 181 additions and 165 deletions

View File

@@ -17,14 +17,16 @@ class TestTKOSubsScanScan:
self.scan = TKOSubsScan(
target_file=__file__, results_dir=str(self.tmp_path), db_location=str(self.tmp_path / "testing.sqlite")
)
self.scan.exception = False
def teardown_method(self):
shutil.rmtree(self.tmp_path)
def test_scan_requires(self):
with patch("pipeline.recon.web.GatherWebTargets"):
retval = self.scan.requires()
assert isinstance(retval, GatherWebTargets)
with patch("pipeline.recon.web.subdomain_takeover.meets_requirements"):
retval = self.scan.requires()
assert isinstance(retval, GatherWebTargets)
def test_scan_creates_results_dir(self):
assert self.scan.results_subfolder == self.tmp_path / "tkosubs-results"
@@ -84,14 +86,16 @@ class TestSubjackScan:
self.scan = SubjackScan(
target_file=__file__, results_dir=str(self.tmp_path), db_location=str(self.tmp_path / "testing.sqlite")
)
self.scan.exception = False
def teardown_method(self):
shutil.rmtree(self.tmp_path)
def test_scan_requires(self):
with patch("pipeline.recon.web.GatherWebTargets"):
retval = self.scan.requires()
assert isinstance(retval, GatherWebTargets)
with patch("pipeline.recon.web.subdomain_takeover.meets_requirements"):
retval = self.scan.requires()
assert isinstance(retval, GatherWebTargets)
def test_scan_creates_results_dir(self):
assert self.scan.results_subfolder == self.tmp_path / "subjack-results"