Exemple #1
0
    def test_check_for_stop_should_return_a_boolean(self):
        """
        Test checkForStop(self)
        """
        sfp = SpiderFootPlugin()

        check_for_stop = sfp.checkForStop()
        self.assertEqual(False, check_for_stop)
Exemple #2
0
    def test_check_for_stop(self):
        """
        Test checkForStop(self)
        """
        sfp = SpiderFootPlugin()

        class DatabaseStub:
            def scanInstanceGet(self, scanId):
                return [None, None, None, None, None, status]

        sfp.__sfdb__ = DatabaseStub()

        # pseudo-parameterized test
        # TODO could include other statuses for completeness
        for status, expectedReturnValue in [("RUNNING", False),
                                            ("ABORT-REQUESTED", True)]:
            returnValue = sfp.checkForStop()
            self.assertEqual(returnValue, expectedReturnValue, status)