From 9f798873c4405485554f132d0ed1731656df2dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0tampar?= Date: Sun, 16 Aug 2026 23:16:16 +0200 Subject: [PATCH] Fixing CI/CD errors --- lib/core/settings.py | 2 +- tests/test_multibit.py | 49 ++++++++++++++++++------------------------ 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index 443d2cca5..45ee6167f 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.10.8.37" +VERSION = "1.10.8.38" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/tests/test_multibit.py b/tests/test_multibit.py index 36ef69fe1..f1a7543a2 100644 --- a/tests/test_multibit.py +++ b/tests/test_multibit.py @@ -39,7 +39,7 @@ assert SQLiteMap ROWS = 96 SMALL = 15 # a real shop listing, far short of the 128 wide window -_WARN = multibit.singleTimeWarnMessage # restored after the cases that capture the nudge +_SAID = (multibit.singleTimeWarnMessage, multibit.singleTimeLogMessage) # hint() speaks through both def tearDownModule(): reset_dbms() @@ -137,6 +137,7 @@ class MultibitTest(unittest.TestCase): # kb.injection is restored by identity above, so its members have to be put back one by one kb.injection.place, kb.injection.parameter, kb.injection.data = self._savedInjection multibit._page = self._savedPage + multibit.singleTimeWarnMessage, multibit.singleTimeLogMessage = _SAID def _attempt(self, secret, length=None, **kwargs): target = _Target(secret, **kwargs) @@ -354,21 +355,26 @@ class MultibitTest(unittest.TestCase): self.assertEqual(value, secret) self.assertEqual(list(kb.multibit.values())[0]["mode"], MULTIBIT_WIDEN) + def _hint(self): + """hint() with everything it could say captured - a nudge is INFO, an unusable back-end a WARNING.""" + + said = [] + multibit.singleTimeWarnMessage = lambda message: said.append(message) + multibit.singleTimeLogMessage = lambda message, level=None, flag=None: said.append(message) + multibit.hint() + + return said + def test_hint_costs_nothing_and_states_the_width(self): # the nudge towards the switch is drawn from the page sqlmap already has, never from a probe conf.multiBit = False # the nudge is for a run that did NOT ask for it kb.originalPage = "".join("" % _ for _ in range(1, 13)) - warned = [] - multibit.singleTimeWarnMessage = lambda message: warned.append(message) - try: - multibit.hint() - finally: - multibit.singleTimeWarnMessage = _WARN + said = self._hint() - self.assertEqual(len(warned), 1) - self.assertIn("12 rows", warned[0]) - self.assertIn("--multi-bit", warned[0]) + self.assertEqual(len(said), 1) + self.assertIn("12 rows", said[0]) + self.assertIn("--multi-bit", said[0]) def test_hint_stays_quiet_on_a_page_that_renders_no_rows(self): # the old trigger announced "the target lists rows" on the nav menu of a single-product DETAIL @@ -380,39 +386,26 @@ class MultibitTest(unittest.TestCase): "C" "

Quantum USB Cable

$9.99

" "
") - multibit.singleTimeWarnMessage = lambda message: self.fail("hinted at a detail page: %s" % message) - try: - multibit.hint() - finally: - multibit.singleTimeWarnMessage = _WARN + self.assertEqual(self._hint(), []) def test_switch_on_an_unsupported_backend_says_so(self): # the bit arithmetic exists for five back-ends; asking for the switch on any other one has to # say why nothing happens instead of silently doing nothing set_dbms(DBMS.FIREBIRD) - warned = [] - multibit.singleTimeWarnMessage = lambda message: warned.append(message) - try: - multibit.hint() - finally: - multibit.singleTimeWarnMessage = _WARN + said = self._hint() - self.assertEqual(len(warned), 1) - self.assertIn("not supported", warned[0]) + self.assertEqual(len(said), 1) + self.assertIn("not supported", said[0]) def test_hint_stays_quiet_when_an_inband_channel_is_available(self): # UNION or error-based beats any row channel, so nudging towards this one would be noise conf.multiBit = False kb.originalPage = "".join("" % _ for _ in range(1, 13)) kb.injection.data[PAYLOAD.TECHNIQUE.UNION] = {} - multibit.singleTimeWarnMessage = lambda message: self.fail("hinted over an in-band channel: %s" % message) - try: - multibit.hint() - finally: - multibit.singleTimeWarnMessage = _WARN + self.assertEqual(self._hint(), []) if __name__ == "__main__": unittest.main()