def test_checkForStop(self): """ Test checkForStop(self) """ sfp = SpiderFootPlugin() class DatabaseStub: def scanInstanceGet(self, scanId): return [None, None, None, None, None, status] sfp.__sfdb__ = DatabaseStub() sfp.__scanId__ = 'example scan id' # pseudo-parameterized test scan_statuses = [(None, False), ("anything", False), ("RUNNING", False), ("ABORT-REQUESTED", True)] for status, expectedReturnValue in scan_statuses: returnValue = sfp.checkForStop() self.assertEqual(returnValue, expectedReturnValue, status)
def test_checkForStop(self): """ Test checkForStop(self) Todo: include other statuses for completeness """ sfp = SpiderFootPlugin() class DatabaseStub: def scanInstanceGet(self, scanId): return [None, None, None, None, None, status] sfp.__sfdb__ = DatabaseStub() sfp.__scanId__ = 'example scan id' # pseudo-parameterized test for status, expectedReturnValue in [("RUNNING", False), ("ABORT-REQUESTED", True)]: returnValue = sfp.checkForStop() self.assertEqual(returnValue, expectedReturnValue, status)